HHH-6100 Bug fix related to CriteriaQuery (JPA) when using XML mappings

This commit is contained in:
Strong Liu 2012-02-20 16:24:55 +08:00
parent 7a9cdb5379
commit ae5d030ae1
2 changed files with 28 additions and 0 deletions

View File

@ -452,6 +452,7 @@ public final class HbmBinder {
prop.setValue( id );
bindProperty( idNode, prop, mappings, inheritedMetas );
entity.setIdentifierProperty( prop );
entity.setDeclaredIdentifierProperty( prop );
}
// TODO:
@ -485,6 +486,7 @@ public final class HbmBinder {
prop.setValue( id );
bindProperty( idNode, prop, mappings, inheritedMetas );
entity.setIdentifierProperty( prop );
entity.setDeclaredIdentifierProperty( prop );
}
makeIdentifier( idNode, id, mappings );
@ -569,6 +571,7 @@ public final class HbmBinder {
throw new MappingException( "Unable to determine entity name" );
}
persistentClass.setEntityName( entityName );
persistentClass.setJpaEntityName( entityName );
bindPojoRepresentation( node, persistentClass, mappings, inheritedMetas );
bindDom4jRepresentation( node, persistentClass, mappings, inheritedMetas );

View File

@ -0,0 +1,25 @@
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<!--
-->
<hibernate-mapping package="org.hibernate.ejb.test.xml">
<class name="Qualifier" table="QUALIFIER">
<id name="qualifierId" column="QUALIFIER_ID" type="long">
<generator class="native"/>
</id>
<property name="name" type="string">
<column name="NAME" length="20" not-null="true"/>
</property>
<property name="value" type="string">
<column name="VALUE" length="1948"/>
</property>
</class>
</hibernate-mapping>