[Hibernate-JIRA] Created: (HHH-3855) AnyType Property not supported.
by Amar Singh (JIRA)
AnyType Property not supported.
-------------------------------
Key: HHH-3855
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3855
Project: Hibernate Core
Issue Type: Bug
Components: envers
Environment: Hibernate 3.4.0-SNAPSHOT, hibernate - envers from trunk
Reporter: Amar Singh
Attachments: anytype.zip
If you have a mapping file with "anytype" configuration, the initialization of configugration says anytype not supported.
Exception thrown is:
Type not supported for auditing: org.hibernate.type.AnyType, on entity org.hibernate.envers.test.integration.onetoone.bidirectional.BidirectionalRefIngPK, property 'data'.
at org.hibernate.envers.configuration.metadata.AuditMetadataGenerator.throwUnsupportedTypeException(AuditMetadataGenerator.java:381)
at org.hibernate.envers.configuration.metadata.AuditMetadataGenerator.addValue(AuditMetadataGenerator.java:147)
at org.hibernate.envers.configuration.metadata.AuditMetadataGenerator.addProperties(AuditMetadataGenerator.java:161)
at org.hibernate.envers.configuration.metadata.AuditMetadataGenerator.generateFirstPass(AuditMetadataGenerator.java:324)
at org.hibernate.envers.configuration.EntitiesConfigurator.configure(EntitiesConfigurator.java:87)
at org.hibernate.envers.configuration.AuditConfiguration.<init>(AuditConfiguration.java:87)
at org.hibernate.envers.configuration.AuditConfiguration.getFor(AuditConfiguration.java:99)
at org.hibernate.envers.event.AuditEventListener.initialize(AuditEventListener.java:249)
at org.hibernate.event.EventListeners$1.processListener(EventListeners.java:198)
at org.hibernate.event.EventListeners.processListeners(EventListeners.java:181)
at org.hibernate.event.EventListeners.initializeListeners(EventListeners.java:194)
TO REPRODUCE
~~~~~~~~~~~~~
Please find a zipped folder attached. The zipped file has 4 files:
- GreedyLoading.java (actual testng test case)
- BidirectionalRefEdPK.java (Entity 1)
- BidirectionalRefIngPK.java (Entity 2)
- greedyloading.hbm.xml
Please place the three java files in its package (org.hibernate.envers.test.integration.onetoone.bidirectional), couldn't find the right package so created test case accordingly. Put the greedyloading.hbm.xml in src/test/resources.
Now when testng runs GreedyLoading.java you should see the exception pasted above.
--
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
15 years, 8 months
[Hibernate-JIRA] Created: (EJB-422) PersistenceException is thrown or not depending on wheter there is @Version annotation
by Paweł Szulc (JIRA)
PersistenceException is thrown or not depending on wheter there is @Version annotation
--------------------------------------------------------------------------------------
Key: EJB-422
URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-422
Project: Hibernate Entity Manager
Issue Type: Bug
Components: EntityManager
Environment: discovered on Windowx XP, using JPA with Hibernate implementation
Reporter: Paweł Szulc
Example:
PriorityProjectRef is normal entity class. If we dont use OptimisticLocking for it (there is no @Version) then test that u can see below will pass. Persisting entity with id set to value of existing entitty will throw an exception - PersistenceException.
@Test(expected = PersistenceException.class)
public void testUniqueKey() {
PriorityProjectRef entity = new PriorityProjectRef();
dao.persist(entity);
PriorityProjectRef entity2 = new PriorityProjectRef();
entity2.setId(entity.getId());
dao.persist(entity2);
}
However if we add to our PriorityProjectRef entity class new field annotated with @Version (to use optimistic locking), the test will fail. There will be no PersistenceException thrown. Second entity will be saved, with new id set from the sequence.
In other words:
without @Version - only one entity persisted, PersistenceException thrown
with @Version - two enites persisted (with different IDs), PersistenceException not thrown
--
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
15 years, 8 months
[Hibernate-JIRA] Created: (HHH-3689) NPE when using composite-map-key and composite-element together in a map
by Jason Maskell (JIRA)
NPE when using composite-map-key and composite-element together in a map
------------------------------------------------------------------------
Key: HHH-3689
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3689
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.3.1
Environment: 3.3.1, MySQL 5
Reporter: Jason Maskell
When trying to get a composite map key working with my composite element class, I ran into this issue. I've seen it reported in a couple of other places since August 08, so it's been around for a while.
<map name="inventory" table="capo_inventory">
<key column="capo_id"/>
<composite-map-key class="ItemCountKey">
<key-many-to-one name="item" column="item_id" class="Item"/>
<key-property name="quality" type="int" column="quality" />
</composite-map-key>
<composite-element class="ItemCount">
<many-to-one name="item" class="com.tamedtornado.data.Item"
formula="item_id" />
<property name="quality" formula="quality" type="int" />
<property name="count" type="int" />
</composite-element>
</map>
This mapping causes this error (root cause):
Caused by: java.lang.NullPointerException
at org.hibernate.util.StringHelper.qualify(StringHelper.java:287)
at org.hibernate.util.StringHelper.qualify(StringHelper.java:301)
at org.hibernate.loader.JoinWalker.walkCompositeElementTree(JoinWalker.java:522)
at org.hibernate.loader.JoinWalker.walkCollectionTree(JoinWalker.java:333)
at org.hibernate.loader.JoinWalker.walkCollectionTree(JoinWalker.java:278)
at org.hibernate.loader.collection.BasicCollectionJoinWalker.<init>(BasicCollectionJoinWalker.java:70)
at org.hibernate.loader.collection.BasicCollectionLoader.<init>(BasicCollectionLoader.java:76)
at org.hibernate.loader.collection.BasicCollectionLoader.<init>(BasicCollectionLoader.java:63)
at org.hibernate.loader.collection.BasicCollectionLoader.<init>(BasicCollectionLoader.java:54)
at org.hibernate.loader.collection.BatchingCollectionInitializer.createBatchingCollectionInitializer(BatchingCollectionInitializer.java:115)
at org.hibernate.persister.collection.BasicCollectionPersister.createCollectionInitializer(BasicCollectionPersister.java:320)
at org.hibernate.persister.collection.AbstractCollectionPersister.postInstantiate(AbstractCollectionPersister.java:563)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:326)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:814)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:732)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
... 65 more
It's quite easy to debug, but I have no idea what it's supposed to be doing, so have no idea how to fix it. The String[] cols parameter passed into walkCompositeElementTree has two nulls in it, which causes the NPE later in the stack. I hope this is easily reproducible, as I'm going to have to write some really grodey code now that I can't easily find my object by those two parameters. :)
--
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
15 years, 8 months
[Hibernate-JIRA] Created: (HHH-3704) Criteria Query on property of sandwich-like @MappedSuperclass fails. HQL works
by Christian kalkhoff (JIRA)
Criteria Query on property of sandwich-like @MappedSuperclass fails. HQL works
------------------------------------------------------------------------------
Key: HHH-3704
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3704
Project: Hibernate Core
Issue Type: Bug
Components: query-criteria
Affects Versions: 3.3.1
Environment: hibernate 3.3.1, mysql 5.0.45
Reporter: Christian kalkhoff
Priority: Minor
I have a hierarchy of @MappedSuperclasses, in my case:
@MappedSuperclass class BaseEntity{...}
@MappedSuperclass class NamedBaseEntity extends BaseEntity {...}
@Entity class ConcreteEntity extends NamedBaseEntity {...}
@Entity class AggregatingOtherEntity extends NamedBaseEntity {
ConcreteEntity concreteEntity;
}
BaseEntity holds property "id", NamedBaseEntity holds property "name". ConcreteEntity might have property "moonphase".
If I create a Criteria search expression on AggregatingOtherEntity like
eq("concreteEntity.id", 1L)
that works.
eq("concreteEntity.moonphase", "half decending") works either.
BUT
like("concreteEntity.name", "foobar")
raises QueryException:
org.hibernate.QueryException: could not resolve property: concreteEntity.name of: AggregatingOtherEntity
org.hibernate.persister.entity.AbstractPropertyMapping.propertyException(AbstractPropertyMapping.java:67)
org.hibernate.persister.entity.AbstractPropertyMapping.toColumns(AbstractPropertyMapping.java:82)
org.hibernate.persister.entity.BasicEntityPropertyMapping.toColumns(BasicEntityPropertyMapping.java:54)
org.hibernate.persister.entity.AbstractEntityPersister.toColumns(AbstractEntityPersister.java:1377)
org.hibernate.loader.criteria.CriteriaQueryTranslator.getColumns(CriteriaQueryTranslator.java:457)
org.hibernate.loader.criteria.CriteriaQueryTranslator.getColumnsUsingProjection(CriteriaQueryTranslator.java:417)
org.hibernate.criterion.SimpleExpression.toSqlString(SimpleExpression.java:68)
org.hibernate.criterion.LogicalExpression.toSqlString(LogicalExpression.java:62)
org.hibernate.loader.criteria.CriteriaQueryTranslator.getWhereCondition(CriteriaQueryTranslator.java:357)
org.hibernate.loader.criteria.CriteriaJoinWalker.<init>(CriteriaJoinWalker.java:113)
org.hibernate.loader.criteria.CriteriaJoinWalker.<init>(CriteriaJoinWalker.java:82)
org.hibernate.loader.criteria.CriteriaLoader.<init>(CriteriaLoader.java:91)
org.hibernate.impl.SessionImpl.list(SessionImpl.java:1577)
org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:306)
[...]
If I refactor the Criteria search to plain HQL (From AggregatingOtherEntity Where concreteEntity.name like 'half decending') it works. So there is a workaround.
--
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
15 years, 8 months