Hibernate中的实体类中的非主键字段,能不能调用oracle的sequence来自动生成序号,然后自动插入数据库
我的配置代码如下:
<property name="objDispidx" type="java.lang.Long">
<column name="OBJ_DISPIDX" precision="10" scale="0" not-null="true" />
<generator class="sequence">
<param name="sequence">MWQ_OBJ_DISPIDX</param>
</generator>
</property>
出现的错误如下:
Caused by: org.hibernate.MappingException: invalid mapping
org.xml.sax.SAXParseException: The content of element type "property" must match "(meta*,(column|formula)*,type?)".
请问是Hibernate不支持这种方式还是我配置的不对??
我的配置代码如下:
<property name="objDispidx" type="java.lang.Long">
<column name="OBJ_DISPIDX" precision="10" scale="0" not-null="true" />
<generator class="sequence">
<param name="sequence">MWQ_OBJ_DISPIDX</param>
</generator>
</property>
出现的错误如下:
Caused by: org.hibernate.MappingException: invalid mapping
org.xml.sax.SAXParseException: The content of element type "property" must match "(meta*,(column|formula)*,type?)".
请问是Hibernate不支持这种方式还是我配置的不对??