[Hibernate-JIRA] Updated: (HHH-1907) offload metadata information from ComponentType to SessionFactory
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1907?page=c... ]
Steve Ebersole updated HHH-1907:
--------------------------------
Fix Version/s: 3.4
Summary: offload metadata information from ComponentType to SessionFactory (was: make ComponentType operate more like EntityType)
Added that HHH-1907 requires HHH-2578 which in the long term is correct to do this cleanly.
However, HHH-2578 is far more ambitious than this issue and is therefore bound to the 4.x time-frame. Would really like to instead get this into earlier releases since it is very very useful.
> offload metadata information from ComponentType to SessionFactory
> -----------------------------------------------------------------
>
> Key: HHH-1907
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1907
> Project: Hibernate Core
> Issue Type: Improvement
> Components: core
> Reporter: Steve Ebersole
> Assignee: Steve Ebersole
> Fix For: 3.4
>
>
> Specifically, we need to move all the code directly dealing with property-access, instantiation, etc out of here. So where do we move it? Well, EntityType for example moves this stuff off to the persisters; the type then just looks up the persister when needed. Not sure we actually need a persister per-se for handling components; perhaps just ComponentMetamodel is enough...
> Why is this important? Well the way ComponentType is currently structured leads to the need for certain configuration properties to be classloader scoped (static on Environment) instead of SessionFactory scoped. This is painful for two in particular: 1) whether to use reflection optimization and 2) bytecode provider.
> Also, this change should allow us to cleanup how property accessors are built
--
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
16 years, 11 months
[Hibernate-JIRA] Created: (HHH-3540) Dynamic model to fetch data (getting Exception when using Set with fetch="join").
by Prosenjit Chakraborty (JIRA)
Dynamic model to fetch data (getting Exception when using Set with fetch="join").
---------------------------------------------------------------------------------
Key: HHH-3540
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3540
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.3.1
Environment: hibernate-distribution-3.3.1.GA
Reporter: Prosenjit Chakraborty
Attachments: entity.hbm.xml
I am using dynamic model to fetch data.
entity.hbm.xml:
============
<hibernate-mapping default-lazy="false">
<class entity-name="en_table1" table="table1">
<id name="tab_id1" column="tab_id1" type="integer"/>
<property name="tab_name1" column="tab_name1" type="string" />
<set name="en_table2s" fetch="join" lazy="false">
<key column="tab_id1"/>
<one-to-many class="en_table2"/>
</set>
</class>
<class entity-name="en_table2" table="table2">
<id name="tab_id2" column="tab_id2" type="integer"/>
<property name="tab_name2" column="tab_name2" type="string" />
<set name="en_table3s" fetch="join" lazy="false">
<key column="tab_id2"/>
<one-to-many class="en_table3"/>
</set>
</class>
<class entity-name="en_table3" table="table3">
<id name="tab_id3" column="tab_id3" type="integer"/>
<property name="tab_name3" column="tab_name3" type="string" />
</class>
</hibernate-mapping>
Data Access Code:
================
Object o=session.get("en_table1",1);
Getting error:
================
org.hibernate.LazyInitializationException: illegal access to loading collection
at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:363)
at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:108)
at org.hibernate.collection.PersistentSet.hashCode(PersistentSet.java:434)
at java.util.HashMap$Entry.hashCode(Unknown Source)
at java.util.AbstractMap.hashCode(Unknown Source)
at java.util.HashMap.put(Unknown Source)
at java.util.HashSet.add(Unknown Source)...........
#####
The problem arises from the second level Set (here, 'set name="en_table3s"' ). For first level set only('set name="en_table2s"') the problem doesn't arise.
Though can be solved by:
<set name="en_table3s" fetch="select" lazy="false">. But, I have to use fetch="join".
So, what should I do now? Please help.
--
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
16 years, 11 months