[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5901?page=c...
]
Frank Griffin commented on HHH-5901:
------------------------------------
orm.xml is in the EAR, but is pretty simple:
<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings
xmlns="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm
http://java.sun.com/xml/ns/persistence/orm_2_0.xsd"
version="2.0">
<!--
This bean uses the IMDB-assigned name key as a unique ID.
-->
<entity class="org.profsoftsvcs.dbutils.DVD.DBUtDVDActorEntityBean"
access="PROPERTY">
<attributes>
<id name="id"/>
</attributes>
</entity>
<!--
This singleton bean uses a fixed value key as a unique ID.
-->
<entity class="org.profsoftsvcs.dbutils.DVD.DBUtDVDStateEntityBean"
access="PROPERTY">
<attributes>
<id name="id"/>
</attributes>
</entity>
<entity class="org.profsoftsvcs.dbutils.DVD.DBUtDVDTitleEntityBean"
access="PROPERTY">
<attributes>
<id name="id">
<generated-value strategy="AUTO"/>
</id>
</attributes>
</entity>
</entity-mappings>
As I said in the description, the field is not even mentioned there, but takes the default
mapping.
transient fields are persisted
------------------------------
Key: HHH-5901
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5901
Project: Hibernate Core
Issue Type: Bug
Components: entity-manager
Affects Versions: 3.6.0
Environment: JBoss 6.0.0.Final using Hypersonic
Reporter: Frank Griffin
Fix For: 3.6.4
Attachments: DBUtDVDTitleEntityBean.java
This is virtually identical to ANN-132, which was marked as FIXED in 3.1.
The attached entity bean (DBUtDVDTitleEntityBean) has a "private transient Object
oDisks" field. The field is not annotated as @Transient, and the orm.xml does not
have a <transient> (or any other) element for the field.
According to spec, the "transient" java attribute should exempt it from
persistence. However, if you deploy the EAR containing this Entity Bean, the error
{noformat}
Caused by: org.hibernate.MappingException: property mapping has wrong number of columns:
org.profsoftsvcs.dbutils.DVD.DBUtDVDTitleEntityBean.disks type: object
at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:464)
[:3.6.0.Final]
at org.hibernate.mapping.RootClass.validate(RootClass.java:235) [:3.6.0.Final]
at org.hibernate.cfg.Configuration.validate(Configuration.java:1332)
[:3.6.0.Final]
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1835)
[:3.6.0.Final]
at
org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:902)
[:3.6.0.Final]
{noformat}
results. If I change the type "Object" to "Serializable", the error
does not occur. However, the fact that "Object" is not Serializable
shouldn't matter if the field isn't being persisted.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira