81,122
社区成员




<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
<property name="url"
value="jdbc:mysql://localhost/fc"></property>
<property name="username" value="root"></property>
<property name="password" value="sa"></property>
<property name="maxActive" value="5"></property>
<property name="maxIdle" value="2"></property>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.MySQL5Dialect
</prop>
<prop key="hibernate.hbm2ddl.auto">create</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
<property name="packagesToScan">
<list>
<value>fc.po.*</value>
</list>
</property>
</bean>
@SuppressWarnings("serial")
@MappedSuperclass
public abstract class PoAbs implements Serializable{
private String dataId;
private String createTime;
private String creater;
private String updateTime;
private String updater;
@Id
@Column(name = "data_id")
@GeneratedValue(generator = "system-uuid")
@GenericGenerator(name = "system-uuid", strategy = "uuid")
public String getDataId() {
return dataId;
}
public void setDataId(String dataId) {
this.dataId = dataId;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public String getCreater() {
return creater;
}
public void setCreater(String creater) {
this.creater = creater;
}
public String getUpdateTime() {
return updateTime;
}
public void setUpdateTime(String updateTime) {
this.updateTime = updateTime;
}
public String getUpdater() {
return updater;
}
public void setUpdater(String updater) {
this.updater = updater;
}
}
@Entity
@Table(name="community")
public class Community extends PoAbs {
private String communtiyName;
private String address;
private District district;
public String getCommuntiyName() {
return communtiyName;
}
public void setCommuntiyName(String communtiyName) {
this.communtiyName = communtiyName;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
@ManyToOne(fetch=FetchType.LAZY)
public District getDistrict() {
return district;
}
public void setDistrict(District district) {
this.district = district;
}
}