[Hibernate-JIRA] Created: (HCANN-26) Possible NPE in MapBinder.bindKeyFromAssociationTable if @JoinColumn not present
by Sergey Vladimirov (JIRA)
Possible NPE in MapBinder.bindKeyFromAssociationTable if @JoinColumn not present
--------------------------------------------------------------------------------
Key: HCANN-26
URL: http://opensource.atlassian.com/projects/hibernate/browse/HCANN-26
Project: Hibernate Commons Annotations
Issue Type: Bug
Affects Versions: 3.1.0.GA
Reporter: Sergey Vladimirov
Priority: Minor
NPE can occur in MapBinder.bindKeyFromAssociationTable if @JoinColumn not present
java.lang.NullPointerException
org.hibernate.cfg.annotations.MapBinder.bindKeyFromAssociationTable(MapBinder.java:161)
org.hibernate.cfg.annotations.MapBinder.access$000(MapBinder.java:77)
org.hibernate.cfg.annotations.MapBinder$1.secondPass(MapBinder.java:111)
org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:66)
org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1221)
org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:383)
org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1206)
org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1449)
org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:193)
org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:1077)
org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:868)
mapKeyType = property.getMapKey().getName();
Hibernate should check if annotation/mapkey specified and throw human-friendly exception, not NPE.
--
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
14 years, 7 months
[Hibernate-JIRA] Commented: (HBX-713) hbm2java task: meta support needed for class level annotations
by Anand Mahajan (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-713?page=co... ]
Anand Mahajan commented on HBX-713:
-----------------------------------
Is the solution to this problem released in any of the hiberante distributions? I want to place certain custom annotations in the hbm2java generated classes so that I can generate Flex Data Transfer object classes (Action Script classes) out of Hibernate entity classes using an DTO2fx Annotations processor.
> hbm2java task: meta support needed for class level annotations
> --------------------------------------------------------------
>
> Key: HBX-713
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-713
> Project: Hibernate Tools
> Issue Type: Bug
> Components: hbm2java
> Affects Versions: 3.2beta6
> Environment: hibernate tools 3.2 beta 6
> JBoss 4.0.4.GA with EJB3
> Reporter: Daniel Pocock
> Attachments: class-annotations.patch
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> We use hbm2java to create EJB3 entity beans from hbm files. It would be really useful to use the `meta' element to insert additional class level annotations. Is someone already working on such a feature, or should I submit a patch?
> Here is an example of what I would like to do:
> <meta attribute="extra-import">org.jboss.seam.annotations.Name</meta>
> <meta attributre="class-annotation">@Name("myObject")</meta>
> such that the following code would be generated:
> import javax.ejb.Entity;
> import org.jboss.seam.annotations.Name;
> @Entity
> @Name("myObject")
> public class MyObject ....
--
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
14 years, 7 months
[Hibernate-JIRA] Created: (HHH-1989) Deleted object remains referenced in 2nd level cache collections
by Justin Haddad (JIRA)
Deleted object remains referenced in 2nd level cache collections
----------------------------------------------------------------
Key: HHH-1989
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1989
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.2.0.cr2
Environment: Spring 1.2.8, Hibernate 3.2, Postgres 8.0.3
Reporter: Justin Haddad
This problem seems identical to issue NH-678. I have enabled caching for an one-to-many association. I use Ehcache. I have a test in which I load the parent object along with its collection. Both the parent and the collection wind up in the 2nd level cache. I then delete an object that is in the collection, not by removing it from the collection, but rather by doing a delete on the object itself. After deleting, I try to reload the parent and get the following exception (User#3102 is the deleted object):
aused by: org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.bluenotenetworks.common.management.sm.User#3102]
at org.hibernate.impl.SessionFactoryImpl$1.handleEntityNotFound(SessionFactoryImpl.java:372)
at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:128)
at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:178)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:86)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:871)
at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:839)
at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:266)
at org.hibernate.type.ManyToOneType.assemble(ManyToOneType.java:177)
at org.hibernate.collection.PersistentSet.initializeFromCache(PersistentSet.java:101)
at org.hibernate.cache.entry.CollectionCacheEntry.assemble(CollectionCacheEntry.java:35)
at org.hibernate.event.def.DefaultInitializeCollectionEventListener.initializeCollectionFromCache(DefaultInitializeCollectionEventListener.java:130)
at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:48)
at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1705)
(continues on)
I stepped through the code in the debugger and can see that the object's ID (3102 in this case) remains in the cached collection even after the deletion.
--
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
14 years, 7 months