Hi everyone.
I have a configuration file with two entities listed:
Code:
<persistence-unit-metadata>
<xml-mapping-metadata-complete />
<persistence-unit-defaults>
<access>PROPERTY</access>
</persistence-unit-defaults>
</persistence-unit-metadata>
<mapped-superclass class="com.demo.domain.impl.TransactionOrSubjectData" metadata-complete="true">
<attributes>
<id name="id">
<column name="TRANSACTIONID"/>
</id>
<basic name="customerReferenceIdentifier">
<column name="CUSTOMERREFERENCEIDENTIFIER"/>
</basic>
</attributes>
</mapped-superclass>
<entity class="com.demo.domain.impl.TransactionData" metadata-complete="true">
<table name="TRANSACTION" />
<attributes>
<basic name="createdDate">
<column name="datecreated"/>
<temporal>TIMESTAMP</temporal>
</basic>
</attributes>
</entity>
The thing is I'm getting the following exception:
Caused by: org.hibernate.MappingException: Could not determine type for: java.util.Map, at table: TRANSACTION, for columns: [org.hibernate.mapping.Column(additionalAttributes)] at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:291)
at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:275)
at org.hibernate.mapping.Property.isValid(Property.java:217)
at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:464)
at org.hibernate.mapping.RootClass.validate(RootClass.java:236)
at org.hibernate.cfg.Configuration.validate(Configuration.java:1193)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1378)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:954)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:891)
... 66 more
The problem is because there is additional properties in that classes that are being mapped automatically (I don't want that).
I tried a lot of options to disable that behavior like: put metadata complete etc. but still I'm getting the same exception.
The only way it works it is when I list every field I don't want mapped to db as transient in the configuration file.
I'm using config file because it is a legacy project I can't add annotations to.
Hibernate version: 3.5.3
Thanks in advance for the help.