[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-6943) hbm with xsd is not working

nick (JIRA) noreply at atlassian.com
Fri Jan 6 11:18:12 EST 2012


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-6943?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44983#comment-44983 ] 

nick commented on HHH-6943:
---------------------------

<hibernate-mapping xmlns="http://www.hibernate.org/xsd/hibernate-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.hibernate.org/xsd/hibernate-mapping hibernate-mapping-4.0.xsd">
<class name="org.egov.commons.Accountdetailkey" table="ACCOUNTDETAILKEY">
<id name="id" type="integer">
<column name="ID" precision="22" scale="0"/>
<generator class="native">
<param name="sequence">SEQ_ACCOUNTDETAILKEY</param>
</generator>
</id>
<many-to-one name="accountdetailtype" class="org.egov.commons.Accountdetailtype" column="DETAILTYPEID"/>
<many-to-one name="chartofaccounts" class="org.egov.commons.CChartOfAccounts" column="GLCODEID"/>
<property name="groupid" column="GROUPID"/>
<property name="detailname" column="DETAILNAME"/>
<property name="detailkey" column="DETAILKEY"/>
</class>
</hibernate-mapping>

when i added unique="true" for column element in the above hbm  its working, but the same was working with old hibernate 3


> hbm with xsd is not working
> ---------------------------
>
>                 Key: HHH-6943
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6943
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 4.0.0.Final
>         Environment: Hibernate 4.0.0 Final + JBoss AS 7 + PostgreSQL
>            Reporter: nick
>            Priority: Critical
>         Attachments: Accountdetailkey.hbm.xml
>
>
> While using any of the following xsd in hbm.xml 
> <hibernate-mapping xmlns="http://www.hibernate.org/xsd/hibernate-mapping"
> 				   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 				   xsi:schemaLocation="http://www.hibernate.org/xsd/hibernate-mapping http://www.hibernate.org/xsd/hibernate-mapping/hibernate-mapping-4.0.xsd">
> Or
> <hibernate-mapping xmlns="http://www.hibernate.org/xsd/hibernate-mapping"
> 				   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 				   xsi:schemaLocation="http://www.hibernate.org/xsd/hibernate-mapping hibernate-mapping-4.0.xsd">
> or
> <hh:hibernate-mapping xmlns:hh="http://www.hibernate.org/xsd/hibernate-mapping"
> 				   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 				   xsi:schemaLocation="http://www.hibernate.org/xsd/hibernate-mapping hibernate-mapping-4.0.xsd">
> Its throwing the following error
> Caused by: java.lang.NullPointerException
> 	at org.hibernate.metamodel.source.hbm.ColumnSourceImpl.isUnique(ColumnSourceImpl.java:109) [hibernate-core-4.0.0.Final.jar:]
> 	at org.hibernate.metamodel.source.binder.Binder.makeColumn(Binder.java:1091) [hibernate-core-4.0.0.Final.jar:]
> 	at org.hibernate.metamodel.source.binder.Binder.bindRelationalValues(Binder.java:1023) [hibernate-core-4.0.0.Final.jar:]
> 	at org.hibernate.metamodel.source.binder.Binder.doBasicSingularAttributeBindingCreation(Binder.java:747) [hibernate-core-4.0.0.Final.jar:]
> 	at org.hibernate.metamodel.source.binder.Binder.bindSimpleIdentifier(Binder.java:331) [hibernate-core-4.0.0.Final.jar:]
> 	at org.hibernate.metamodel.source.binder.Binder.bindIdentifier(Binder.java:314) [hibernate-core-4.0.0.Final.jar:]
> 	at org.hibernate.metamodel.source.binder.Binder.makeRootEntityBinding(Binder.java:183) [hibernate-core-4.0.0.Final.jar:]
> 	at org.hibernate.metamodel.source.binder.Binder.createBasicEntityBinding(Binder.java:159) [hibernate-core-4.0.0.Final.jar:]
> 	at org.hibernate.metamodel.source.binder.Binder.doCreateEntityBinding(Binder.java:147) [hibernate-core-4.0.0.Final.jar:]
> 	at org.hibernate.metamodel.source.binder.Binder.createEntityBinding(Binder.java:132) [hibernate-core-4.0.0.Final.jar:]
> 	at org.hibernate.metamodel.source.binder.Binder.processEntityHierarchy(Binder.java:108) [hibernate-core-4.0.0.Final.jar:]
> 	at org.hibernate.metamodel.source.hbm.HbmMetadataSourceProcessorImpl.processMappingMetadata(HbmMetadataSourceProcessorImpl.java:88) [hibernate-core-4.0.0.Final.jar:]
> 	at org.hibernate.metamodel.source.internal.MetadataImpl.bindMappingMetadata(MetadataImpl.java:195) [hibernate-core-4.0.0.Final.jar:]
> 	at org.hibernate.metamodel.source.internal.MetadataImpl.<init>(MetadataImpl.java:165) [hibernate-core-4.0.0.Final.jar:]
> 	at org.hibernate.metamodel.source.internal.MetadataBuilderImpl.buildMetadata(MetadataBuilderImpl.java:83) [hibernate-core-4.0.0.Final.jar:]
> 	at org.hibernate.metamodel.MetadataSources.buildMetadata(MetadataSources.java:112) [hibernate-core-4.0.0.Final.jar:]
> I'm attaching one of my hbm file which creating this error.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list