W3Cschool
恭喜您成為首批注冊(cè)用戶(hù)
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
//DemoUser類(lèi)源碼 @Entity @Table(name="DEMO_USER") public class DemoUser {
@Id @Column(name="USERNAME_",length=60) private String username; @Column(name="MALE_",nullable=false) private boolean male=true; @Column(name="BIRTHDAY_") private Date birthday; @Column(name="MOBILE_",length=20) private String mobile; @Column(name="ADDRESS_",length=120) private String address; @Column(name="EMAIL_",length=60) private String email; public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public boolean isMale() { return male; } public void setMale(boolean male) { this.male = male; } public Date getBirthday() { return birthday; } public void setBirthday(Date birthday) { this.birthday = birthday; } public String getMobile() { return mobile; } public void setMobile(String mobile) { this.mobile = mobile; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } }
datasources.xml部分配置源碼
<bean id="sessionFactory" parent="bdf2.sessionFactory">
<property name="dataSourceName" value="hsql" />
<property name="entityInterceptor" ref="bdf2.unByteCodeProxyInterceptor" />
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</prop>
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
</props>
</property>
<property name="packagesToScan">
<list>
<value>com/bstek/demo/model</value>
</list>
</property>
</bean>
Copyright©2021 w3cschool編程獅|閩ICP備15016281號(hào)-3|閩公網(wǎng)安備35020302033924號(hào)
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號(hào)
聯(lián)系方式:
更多建議: