Hibernate: insert into jos_content (id, title, alias, title_alias, introtext, fulltext, state, sectionid, mask, catid, created, created_by, created_by_alias, modified, modified_by, checked_out, checked_out_time, publish_up, publish_down, images, urls, attribs, version, parentid, ordering, metakey, metadesc, access, hits, metadata) values 由于字段fulltext是关键字, 所以不能插入数据库,
怎么修改一下, 可以使能插入数据库
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping> <class name="com.joomla.dao.JosContent" table="jos_content" lazy="true">
<id name="id" column="id" type="int">
<generator class="identity"/>
</id>
<property name="title"
not-null="true"
column="title" type="string"/>
<property name="alias"
not-null="true"
column="alias" type="string"/>
<property name="title_alias"
not-null="false"
column="title_alias" type="string"/>
<property name="introtext"
not-null="true"
column="introtext" type="string"/>
<property name="fulltext"
not-null="true"
column="fulltext" type="string"/>
<property name="state"
not-null="true"
column="state" type="int"/>
<property name="sectionid"
not-null="true"
column="sectionid" type="int"/>
<property name="mask"
not-null="true"
column="mask" type="int"/>
<property name="catid"
not-null="true"
column="catid" type="int"/> <property name="created"
not-null="true"
column="created" type="date"/>
<property name="created_by"
not-null="true"
column="created_by" type="int"/> <property name="created_by_alias"
not-null="true"
column="created_by_alias" type="string"/>
<property name="modified"
not-null="true"
column="modified" type="date"/>
<property name="modified_by"
not-null="true"
column="modified_by" type="int"/> <property name="checked_out"
not-null="true"
column="checked_out" type="int"/> <property name="checked_out_time"
not-null="true"
column="checked_out_time" type="date"/>
<property name="publish_up"
not-null="true"
column="publish_up" type="date"/> <property name="publish_down"
not-null="true"
column="publish_down" type="date"/> <property name="images"
not-null="true"
column="images" type="string"/> <property name="urls"
not-null="true"
column="urls" type="string"/> <property name="attribs"
not-null="true"
column="attribs" type="string"/> <property name="version"
not-null="true"
column="version" type="int"/> <property name="parentid"
not-null="true"
column="parentid" type="int"/> <property name="ordering"
not-null="true"
column="ordering" type="int"/> <property name="metakey"
not-null="true"
column="metakey" type="string"/> <property name="metadesc"
not-null="true"
column="metadesc" type="string"/>
<property name="access"
not-null="true"
column="access" type="int"/>
<property name="hits"
not-null="true"
column="hits" type="int"/>
<property name="metadata"
not-null="true"
column="metadata" type="string"/>
</class>
</hibernate-mapping>
怎么修改一下, 可以使能插入数据库
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping> <class name="com.joomla.dao.JosContent" table="jos_content" lazy="true">
<id name="id" column="id" type="int">
<generator class="identity"/>
</id>
<property name="title"
not-null="true"
column="title" type="string"/>
<property name="alias"
not-null="true"
column="alias" type="string"/>
<property name="title_alias"
not-null="false"
column="title_alias" type="string"/>
<property name="introtext"
not-null="true"
column="introtext" type="string"/>
<property name="fulltext"
not-null="true"
column="fulltext" type="string"/>
<property name="state"
not-null="true"
column="state" type="int"/>
<property name="sectionid"
not-null="true"
column="sectionid" type="int"/>
<property name="mask"
not-null="true"
column="mask" type="int"/>
<property name="catid"
not-null="true"
column="catid" type="int"/> <property name="created"
not-null="true"
column="created" type="date"/>
<property name="created_by"
not-null="true"
column="created_by" type="int"/> <property name="created_by_alias"
not-null="true"
column="created_by_alias" type="string"/>
<property name="modified"
not-null="true"
column="modified" type="date"/>
<property name="modified_by"
not-null="true"
column="modified_by" type="int"/> <property name="checked_out"
not-null="true"
column="checked_out" type="int"/> <property name="checked_out_time"
not-null="true"
column="checked_out_time" type="date"/>
<property name="publish_up"
not-null="true"
column="publish_up" type="date"/> <property name="publish_down"
not-null="true"
column="publish_down" type="date"/> <property name="images"
not-null="true"
column="images" type="string"/> <property name="urls"
not-null="true"
column="urls" type="string"/> <property name="attribs"
not-null="true"
column="attribs" type="string"/> <property name="version"
not-null="true"
column="version" type="int"/> <property name="parentid"
not-null="true"
column="parentid" type="int"/> <property name="ordering"
not-null="true"
column="ordering" type="int"/> <property name="metakey"
not-null="true"
column="metakey" type="string"/> <property name="metadesc"
not-null="true"
column="metadesc" type="string"/>
<property name="access"
not-null="true"
column="access" type="int"/>
<property name="hits"
not-null="true"
column="hits" type="int"/>
<property name="metadata"
not-null="true"
column="metadata" type="string"/>
</class>
</hibernate-mapping>
解决方案 »
- 16進制字符串轉換成byte數組
- 想修改第三方的jar包里的一个class,无法重新编译(在线等)
- 打包成jar找不到.properties文件的问题
- java.lang.NullPointerException???
- 一个简单问题,但就是弄不明白,希望各位可以帮我解答
- 请高手帮忙
- 如何在Applet内用专用数据库驱动程序访问ACCESS数据库呀????
- eclipse怎样设置才能让程序能用oracle的驱动呢?
- hashCode为什么这么写?
- 谁有 JAVA 1.3.2 供下载? 据说在 WIN 2000 下, 1.4还不如 1.3.2好使呢?
- 关于动态绑定和方法的重写的问题。。请指导下。。
- 一个小小的JAVA程序?总是运行不了?
not-null="true"
column="fulltext" type="string"/> column名字换掉啊