请教?hibernate.cfg.xml 配置问题
请教下
<hibernate-mapping>
<class name="com.song.shopping.entity.User" table="SHOPPING_SONG_USER" schema="OPENLAB">
<id name="userId" type="long">
<column name="USER_ID" precision="22" scale="0" />
<generator class="hilo" />
</id>
<property name="username" type="string">
<column name="USERNAME" length="32" not-null="true" unique="true" />
</property>
<property name="userpwd" type="string">
<column name="USERPWD" length="32" not-null="true" />
</property>
<property name="useremail" type="string">
<column name="USEREMAIL" length="64" not-null="true" />
</property>
<property name="telphone" type="string">
<column name="TELPHONE" length="20" />
</property>
<set name="shoppingSongOrders" inverse="true">
<key>
<column name="USER_ID" precision="22" scale="0" not-null="true" />
</key>
<one-to-many class="com.song.shopping.entity.Order" />
</set>
</class>
</hibernate-mapping>
<id name="userId" type="long">
<column name="USER_ID" precision="22" scale="0" />
<generator class="hilo" />
</id>
上面的配置文件中 主键必须有序列吗?有没有没有序列的时候,没有序列的情况下如何写配置文件?
<hibernate-mapping>
<class name="com.song.shopping.entity.User" table="SHOPPING_SONG_USER" schema="OPENLAB">
<id name="userId" type="long">
<column name="USER_ID" precision="22" scale="0" />
<generator class="hilo" />
</id>
<property name="username" type="string">
<column name="USERNAME" length="32" not-null="true" unique="true" />
</property>
<property name="userpwd" type="string">
<column name="USERPWD" length="32" not-null="true" />
</property>
<property name="useremail" type="string">
<column name="USEREMAIL" length="64" not-null="true" />
</property>
<property name="telphone" type="string">
<column name="TELPHONE" length="20" />
</property>
<set name="shoppingSongOrders" inverse="true">
<key>
<column name="USER_ID" precision="22" scale="0" not-null="true" />
</key>
<one-to-many class="com.song.shopping.entity.Order" />
</set>
</class>
</hibernate-mapping>
<id name="userId" type="long">
<column name="USER_ID" precision="22" scale="0" />
<generator class="hilo" />
</id>
上面的配置文件中 主键必须有序列吗?有没有没有序列的时候,没有序列的情况下如何写配置文件?
...全文
相关推荐
hibernate.cfg.xml文件详细解释
hibernate.cfg.xml文件详细解释收集的一个比较好的hibernate.cfg.xml文件解释
SSH框架配置步骤图解(Struts2.1.6 Spring2.5.6 Hibernate3.3.1 2
SSH框架配置步骤图解(Struts2.1.6 Spring2.5.6 Hibernate3.3.1 2)看看是否能帮到你
hibenate成功配置文件
hibenate成功配置文件 代码源自:《零基础学struts》 自己经过几次周折配置成功,新手配置还会有一定难度,下载了配置不成功,请不要投反票哦
hibernate 笔记
hibernate 学习笔记,主要是平常项目总结和运用
Struts+Spring+Hibernate补充内容
在SSH中实现以下功能时, 需要将Tomcat中站点目录下/WEB-INF/lib 中的asm-2.2.3.jar和commons-collections-2.1.1.jar 文件删除,否则会引起类冲突 分离配置文件: 在src目录下创建多个xml文件,分别配制项目中的 action,dao,manage,common(sessionfactory,事务,AOP) 以相同的前缀开头,以action,dao,manage,common结尾 文件中配制的语法与原来一样


Web 开发
