hibernate reports an error

1. hibernate 自关联 could not resolve property: parentColumn of:       com.tekview.apex.itsm.common.bo.columnInfo.Column

   解决方案:  /**
     * @hibernate.
collection-many-to-one class="com.tekview.apex.itsm.common.bo.columnInfo.Column"   column="parentId" not-null="false"
     * return
     */

  Should be changed to:

  /**
     * @hibernate.many-to-one class="com.tekview.apex.itsm.common.bo.columnInfo.Column" column="parentId" not-null="false"
     * return
     */

 

 

2. mysql Unknown column 'column0_.fixedColumn' in 'field list'

solution:

/**
     * @hibernate.property type="boolean"
     */

hibernate.property does not have type="boolean" and should be modified to:

/**
     * @hibernate.property type="byte"
     */

 

The database does not recognize boolean, use other types instead, number or varchar
If you use boolean in your class and varchar in the database, write the type of property in the mapping file as yes_no, the database will save Y and N, when hql is executed, hibernate will convert Y and true, N and false to each other, <property name="visible" type="yes_no" />.
If you use boolean in your class and number in the database, write the type of property in the mapping file as byte, the database will save 1 and 0, and when hql is executed, hibernate will convert 1 and true, 0 and false to each other , <property name="visible" type="byte" />.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326236214&siteId=291194637