[Hibernate-JIRA] Commented: (HHH-1134) subclass tag with discriminator in one to many mapping
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1134?page=c... ]
Steve Ebersole commented on HHH-1134:
-------------------------------------
Oh, so then you'd agree that categorizing this as making "Hibernate EntityManager non-spec-compliant" is silly?
Is it a limitation? Sure. Is it enough of a limitation that someone actually started working up a patch for this? Umm, apparently not. Therefore, hardly blocker I'd say...
> subclass tag with discriminator in one to many mapping
> ------------------------------------------------------
>
> Key: HHH-1134
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1134
> Project: Hibernate3
> Issue Type: Bug
> Components: core
> Environment: hibernate 3.0.5, Oracle
> Reporter: Dilip Ranjith
>
> Consider the following hbm.xml file
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE hibernate-mapping PUBLIC
> "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
> "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
> <hibernate-mapping
> >
> <class
> name="DCDTO"
> table="ACCDC"
> dynamic-update="true"
> >
> <id
> name="ID"
> type="java.lang.String"
> >
> <column
> name="DCINFOID"
> />
> <generator class="sequence">
> <param name="sequence">DSEQ</param>
> <!--
> To add non XDoclet generator parameters, create a file named
> hibernate-generator-params-DebtorCreditorDTO.xml
> containing the additional parameters and place it in your merge dir.
> -->
> </generator>
> </id>
> <discriminator
> column="accountType"
> not-null="true"
> type="java.lang.String"
> force="true"
> insert="true"
> />
> <property
> name="creditMax"
> type="java.lang.Double"
> update="true"
> insert="true"
> column="creditMax"
> />
> <subclass
> name="CDTO"
> dynamic-update="true"
> dynamic-insert="true"
> discriminator-value="C"
> >
> </.subclass>
> <subclass
> name="DDTO"
> dynamic-update="true"
> dynamic-insert="true"
> discriminator-value="D"
> >
> </.subclass>
> </class>
> </hibernate-mapping>
> DCDTO is the super class while DDTO and CDTO are its child classes
> If in a mapped object say TDTO there are a set of CDTOs and a separate set of DDTOs
> when we get TDTO the where clause "where accountType='D' " is not there when the query for set of DDTOs are generated. so instead of a set of DDTOs i am getting a set of both DDTO's and CDTO's
--
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
18 years, 3 months
[Hibernate-JIRA] Commented: (HHH-1134) subclass tag with discriminator in one to many mapping
by Morten Andersen-Gott (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1134?page=c... ]
Morten Andersen-Gott commented on HHH-1134:
-------------------------------------------
Well, if you define the spec merely by what passes the TCK then yes, it's spec compliant. Still there are a couple of major bugs that hasn't been revieled by the tck, that in my opinion makes the Hibernate EntityManager an insufficient JPA product.
> subclass tag with discriminator in one to many mapping
> ------------------------------------------------------
>
> Key: HHH-1134
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1134
> Project: Hibernate3
> Issue Type: Bug
> Components: core
> Environment: hibernate 3.0.5, Oracle
> Reporter: Dilip Ranjith
>
> Consider the following hbm.xml file
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE hibernate-mapping PUBLIC
> "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
> "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
> <hibernate-mapping
> >
> <class
> name="DCDTO"
> table="ACCDC"
> dynamic-update="true"
> >
> <id
> name="ID"
> type="java.lang.String"
> >
> <column
> name="DCINFOID"
> />
> <generator class="sequence">
> <param name="sequence">DSEQ</param>
> <!--
> To add non XDoclet generator parameters, create a file named
> hibernate-generator-params-DebtorCreditorDTO.xml
> containing the additional parameters and place it in your merge dir.
> -->
> </generator>
> </id>
> <discriminator
> column="accountType"
> not-null="true"
> type="java.lang.String"
> force="true"
> insert="true"
> />
> <property
> name="creditMax"
> type="java.lang.Double"
> update="true"
> insert="true"
> column="creditMax"
> />
> <subclass
> name="CDTO"
> dynamic-update="true"
> dynamic-insert="true"
> discriminator-value="C"
> >
> </.subclass>
> <subclass
> name="DDTO"
> dynamic-update="true"
> dynamic-insert="true"
> discriminator-value="D"
> >
> </.subclass>
> </class>
> </hibernate-mapping>
> DCDTO is the super class while DDTO and CDTO are its child classes
> If in a mapped object say TDTO there are a set of CDTOs and a separate set of DDTOs
> when we get TDTO the where clause "where accountType='D' " is not there when the query for set of DDTOs are generated. so instead of a set of DDTOs i am getting a set of both DDTO's and CDTO's
--
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
18 years, 3 months
[Hibernate-JIRA] Commented: (HHH-1134) subclass tag with discriminator in one to many mapping
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1134?page=c... ]
Steve Ebersole commented on HHH-1134:
-------------------------------------
Actually, I'd argue that the fact that Hibernate has long since passed the JPA TCK that it is in fact not "non-spec-compliant". Kinda the definition of being spec compliant, no?
> subclass tag with discriminator in one to many mapping
> ------------------------------------------------------
>
> Key: HHH-1134
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1134
> Project: Hibernate3
> Issue Type: Bug
> Components: core
> Environment: hibernate 3.0.5, Oracle
> Reporter: Dilip Ranjith
>
> Consider the following hbm.xml file
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE hibernate-mapping PUBLIC
> "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
> "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
> <hibernate-mapping
> >
> <class
> name="DCDTO"
> table="ACCDC"
> dynamic-update="true"
> >
> <id
> name="ID"
> type="java.lang.String"
> >
> <column
> name="DCINFOID"
> />
> <generator class="sequence">
> <param name="sequence">DSEQ</param>
> <!--
> To add non XDoclet generator parameters, create a file named
> hibernate-generator-params-DebtorCreditorDTO.xml
> containing the additional parameters and place it in your merge dir.
> -->
> </generator>
> </id>
> <discriminator
> column="accountType"
> not-null="true"
> type="java.lang.String"
> force="true"
> insert="true"
> />
> <property
> name="creditMax"
> type="java.lang.Double"
> update="true"
> insert="true"
> column="creditMax"
> />
> <subclass
> name="CDTO"
> dynamic-update="true"
> dynamic-insert="true"
> discriminator-value="C"
> >
> </.subclass>
> <subclass
> name="DDTO"
> dynamic-update="true"
> dynamic-insert="true"
> discriminator-value="D"
> >
> </.subclass>
> </class>
> </hibernate-mapping>
> DCDTO is the super class while DDTO and CDTO are its child classes
> If in a mapped object say TDTO there are a set of CDTOs and a separate set of DDTOs
> when we get TDTO the where clause "where accountType='D' " is not there when the query for set of DDTOs are generated. so instead of a set of DDTOs i am getting a set of both DDTO's and CDTO's
--
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
18 years, 3 months
[Hibernate-JIRA] Commented: (HHH-1134) subclass tag with discriminator in one to many mapping
by Morten Andersen-Gott (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1134?page=c... ]
Morten Andersen-Gott commented on HHH-1134:
-------------------------------------------
This is a blocker in the way that it makes Hibernate EntityManager non-spec-compliant.
See:
http://forums.java.net/jive/thread.jspa?threadID=29206
> subclass tag with discriminator in one to many mapping
> ------------------------------------------------------
>
> Key: HHH-1134
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1134
> Project: Hibernate3
> Issue Type: Bug
> Components: core
> Environment: hibernate 3.0.5, Oracle
> Reporter: Dilip Ranjith
>
> Consider the following hbm.xml file
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE hibernate-mapping PUBLIC
> "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
> "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
> <hibernate-mapping
> >
> <class
> name="DCDTO"
> table="ACCDC"
> dynamic-update="true"
> >
> <id
> name="ID"
> type="java.lang.String"
> >
> <column
> name="DCINFOID"
> />
> <generator class="sequence">
> <param name="sequence">DSEQ</param>
> <!--
> To add non XDoclet generator parameters, create a file named
> hibernate-generator-params-DebtorCreditorDTO.xml
> containing the additional parameters and place it in your merge dir.
> -->
> </generator>
> </id>
> <discriminator
> column="accountType"
> not-null="true"
> type="java.lang.String"
> force="true"
> insert="true"
> />
> <property
> name="creditMax"
> type="java.lang.Double"
> update="true"
> insert="true"
> column="creditMax"
> />
> <subclass
> name="CDTO"
> dynamic-update="true"
> dynamic-insert="true"
> discriminator-value="C"
> >
> </.subclass>
> <subclass
> name="DDTO"
> dynamic-update="true"
> dynamic-insert="true"
> discriminator-value="D"
> >
> </.subclass>
> </class>
> </hibernate-mapping>
> DCDTO is the super class while DDTO and CDTO are its child classes
> If in a mapped object say TDTO there are a set of CDTOs and a separate set of DDTOs
> when we get TDTO the where clause "where accountType='D' " is not there when the query for set of DDTOs are generated. so instead of a set of DDTOs i am getting a set of both DDTO's and CDTO's
--
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
18 years, 3 months
[Hibernate-JIRA] Updated: (HHH-1131) setting classloader in CGLIB class generators
by Christian Bauer (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1131?page=c... ]
Christian Bauer updated HHH-1131:
---------------------------------
Comment: was deleted
> setting classloader in CGLIB class generators
> ---------------------------------------------
>
> Key: HHH-1131
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1131
> Project: Hibernate3
> Issue Type: Improvement
> Components: core
> Affects Versions: 3.0.5
> Environment: Hibernate 3.0.5, Oracle 10
> Reporter: Moshe Ben Shoham
>
> In my application I am loading plug-ins mapping documents and persistent classes from jars using some UrlClassLoaders (one per plugin). I then set the threadContextClassLoader to be the CompositeClassLoader that holds all those UrlClassLoaders. Everything works fine until I add a proxy to one of the mapping document (I simplified the names a little):
> <hibernate-mapping>
> <subclass
> name="myplugin.MyExtension"
> discriminator-value="3"
> proxy="myplugin.IMyExtension"
> extends="core.MyBasicClass"
> >
> <join table="MY_EXTENSION">
> <key column="ENTITY_ID"/>
> <property name="extraNumData" column="EXTRA_NUM_DATA" type="long"/>
> <property name="extraStrData" column="EXTRA_STR_DATA" type="string"/>
> </join>
> </subclass >
> </hibernate-mapping>
> See below the exception I get.
> Hibernate uses net.sf.cglib.proxy.Enhancer as the class generator in CGLIBLazyInitializer.getProxyFactory(). Now, it seeme like CGLIB allows customizing the ClassLoader used by its class generators using the method net.sf.cglib.core.AbstractClassGenerator.setClassLoader() (Enhancer extends AbstractClassGenerator). But, it doesn't seem like it is possible to use it in Hibernate, because this is how the Enhancer is used in CGLIBLazyInitializer.getProxyFactory() :
> return (Factory) Enhancer.create(
> (interfaces.length==1) ? persistentClass : null,
> interfaces,
> NULL_METHOD_INTERCEPTOR
> );
> If I replace it with the following code, it works:
> Enhancer e = new Enhancer();
> e.setSuperclass((interfaces.length==1) ? persistentClass : null);
> e.setInterfaces(interfaces);
> e.setCallback(NULL_METHOD_INTERCEPTOR);
> e.setClassLoader(Thread.currentThread().getContextClassLoader()); // this is the addition!
> return (Factory)e.create();
> Is there any other way I can do it (I know I can implement my own persister, but it seems like there's too much code that needs to be overridden...)?
> Is there any planned enhancement regarding this issue?
> Full stack trace of any exception that occurs:
> CGLIB Enhancement failed: com.octavian.fas.domain.business.BusinessTransaction
> net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
> at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:236)
> at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:373)
> at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:281)
> at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:640)
> at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:94)
> at org.hibernate.proxy.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:42)
> at org.hibernate.tuple.PojoTuplizer.buildProxyFactory(PojoTuplizer.java:144)
> at org.hibernate.tuple.AbstractTuplizer.<init>(AbstractTuplizer.java:83)
> at org.hibernate.tuple.PojoTuplizer.<init>(PojoTuplizer.java:54)
> at org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.java:47)
> at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:218)
> at org.hibernate.persister.entity.BasicEntityPersister.<init>(BasicEntityPersister.java:400)
> at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:104)
> at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
> at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:211)
> at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1005)
> at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:777)
> at org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:703)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1058)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:363)
> at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
> at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
> at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:269)
> at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:318)
> at com.octavian.sma.analytical.batch.SpringHelper.init(SpringHelper.java:77)
> at com.octavian.sma.analytical.batch.SpringHelper.<init>(SpringHelper.java:38)
> at com.octavian.sma.analytical.batch.dailynongrouping.DailyNonGroupingAnalyticalBatch.initSpringHelper(DailyNonGroupingAnalyticalBatch.java:44)
> at com.octavian.sma.analytical.batch.AnalyticalBatch.run(AnalyticalBatch.java:58)
> at com.octavian.sma.analytical.batch.dailynongrouping.DailyNonGroupingAnalyticalBatch.main(DailyNonGroupingAnalyticalBatch.java:29)
> Caused by: java.lang.reflect.InvocationTargetException
> at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:373)
> at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:218)
> ... 28 more
> Caused by: java.lang.NoClassDefFoundError: myplugin/IMyBusinessTransactionExtension
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
> ... 33 more
--
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
18 years, 3 months
[Hibernate-JIRA] Created: (HSHARDS-47) A set of changes applied to the project
by Aviad Lichtenstadt (JIRA)
A set of changes applied to the project
---------------------------------------
Key: HSHARDS-47
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSHARDS-47
Project: Hibernate Shards
Issue Type: Patch
Affects Versions: 3.0.0.Beta2
Reporter: Aviad Lichtenstadt
Assignee: Max Ross
Attachments: AllSourceChanges.txt
org/hibernate/shards/Shard.java:
* Support for executeUpdate - straight forward, just execute on all shards
org/hibernate/shards/session/ShardedSessionImpl.java
* Change implementation of is open (discussed already with Max
* Add support for SQLQuery in the Shard object, at this time only the implementation that is identical to the regular hql Query
org/hibernate/shards/criteria/ShardedCriteriaImpl.java
* Support for PropertyProjection
* Correct support for AggregateProjection (max, min) so they will be done in the database
org/hibernate/shards/criteria/AggregateProjectionEvent.java
* An event so the projection can be done in the database.
org/hibernate/shards/criteria/ExitOperationsCriteriaCollector.java
* Correct compilation of results for PropertyProjection including ordering with property projection which is a special case
org/hibernate/shards/criteria/GeneralProjectionEvent.java
* A general Projection event needed for lazily adding the property projection (specially for cases were there are also ordering in the criteria)
org/hibernate/shards/criteria/CountProjectionEvent.java
* A count projection event (including distinct count, so the count will be in the database) and the collector will only need to collect the numbers
org/hibernate/shards/strategy/exit/AggregateExitOperation.java
* add correct support for max and min
* add support for count
* add support for distinct count
org/hibernate/shards/strategy/exit/OrderExitOperation.java
* Make utility method public so can be used in other classes
org/hibernate/shards/strategy/exit/PropertyProjectionOrderExitOperation.java
* Support for ordering in cases of property projection
org/hibernate/shards/strategy/exit/PropertyProjectionExitOperation.java
* Support for property projection (return always the first element of the returned result set)
org/hibernate/shards/ShardImpl.java
* Support for SQLQuery
* Support for execute update operation
org/hibernate/shards/query/ShardedSQLQueryImpl.java
* Implementation for SQLQuery using Shards, all the implemented operations are just the same as the hql query, the rest is not supported
org/hibernate/shards/query/ShardedSQLQuery.java
* An interface for SQLQuery using Shards
org/hibernate/shards/query/ShardedQueryImpl.java
* Support execute update operation
org/hibernate/shards/query/AdHocQueryFactoryImpl.java
* Support creation of SQLQuery
--
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
18 years, 3 months
[Hibernate-JIRA] Commented: (HHH-1131) setting classloader in CGLIB class generators
by Stéphane Routhiau (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1131?page=c... ]
Stéphane Routhiau commented on HHH-1131:
----------------------------------------
We have the same problem with a dynamic classloader implementation.
Please fix !
> setting classloader in CGLIB class generators
> ---------------------------------------------
>
> Key: HHH-1131
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1131
> Project: Hibernate3
> Issue Type: Improvement
> Components: core
> Affects Versions: 3.0.5
> Environment: Hibernate 3.0.5, Oracle 10
> Reporter: Moshe Ben Shoham
>
> In my application I am loading plug-ins mapping documents and persistent classes from jars using some UrlClassLoaders (one per plugin). I then set the threadContextClassLoader to be the CompositeClassLoader that holds all those UrlClassLoaders. Everything works fine until I add a proxy to one of the mapping document (I simplified the names a little):
> <hibernate-mapping>
> <subclass
> name="myplugin.MyExtension"
> discriminator-value="3"
> proxy="myplugin.IMyExtension"
> extends="core.MyBasicClass"
> >
> <join table="MY_EXTENSION">
> <key column="ENTITY_ID"/>
> <property name="extraNumData" column="EXTRA_NUM_DATA" type="long"/>
> <property name="extraStrData" column="EXTRA_STR_DATA" type="string"/>
> </join>
> </subclass >
> </hibernate-mapping>
> See below the exception I get.
> Hibernate uses net.sf.cglib.proxy.Enhancer as the class generator in CGLIBLazyInitializer.getProxyFactory(). Now, it seeme like CGLIB allows customizing the ClassLoader used by its class generators using the method net.sf.cglib.core.AbstractClassGenerator.setClassLoader() (Enhancer extends AbstractClassGenerator). But, it doesn't seem like it is possible to use it in Hibernate, because this is how the Enhancer is used in CGLIBLazyInitializer.getProxyFactory() :
> return (Factory) Enhancer.create(
> (interfaces.length==1) ? persistentClass : null,
> interfaces,
> NULL_METHOD_INTERCEPTOR
> );
> If I replace it with the following code, it works:
> Enhancer e = new Enhancer();
> e.setSuperclass((interfaces.length==1) ? persistentClass : null);
> e.setInterfaces(interfaces);
> e.setCallback(NULL_METHOD_INTERCEPTOR);
> e.setClassLoader(Thread.currentThread().getContextClassLoader()); // this is the addition!
> return (Factory)e.create();
> Is there any other way I can do it (I know I can implement my own persister, but it seems like there's too much code that needs to be overridden...)?
> Is there any planned enhancement regarding this issue?
> Full stack trace of any exception that occurs:
> CGLIB Enhancement failed: com.octavian.fas.domain.business.BusinessTransaction
> net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
> at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:236)
> at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:373)
> at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:281)
> at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:640)
> at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:94)
> at org.hibernate.proxy.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:42)
> at org.hibernate.tuple.PojoTuplizer.buildProxyFactory(PojoTuplizer.java:144)
> at org.hibernate.tuple.AbstractTuplizer.<init>(AbstractTuplizer.java:83)
> at org.hibernate.tuple.PojoTuplizer.<init>(PojoTuplizer.java:54)
> at org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.java:47)
> at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:218)
> at org.hibernate.persister.entity.BasicEntityPersister.<init>(BasicEntityPersister.java:400)
> at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:104)
> at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
> at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:211)
> at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1005)
> at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:777)
> at org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:703)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1058)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:363)
> at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
> at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
> at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:269)
> at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:318)
> at com.octavian.sma.analytical.batch.SpringHelper.init(SpringHelper.java:77)
> at com.octavian.sma.analytical.batch.SpringHelper.<init>(SpringHelper.java:38)
> at com.octavian.sma.analytical.batch.dailynongrouping.DailyNonGroupingAnalyticalBatch.initSpringHelper(DailyNonGroupingAnalyticalBatch.java:44)
> at com.octavian.sma.analytical.batch.AnalyticalBatch.run(AnalyticalBatch.java:58)
> at com.octavian.sma.analytical.batch.dailynongrouping.DailyNonGroupingAnalyticalBatch.main(DailyNonGroupingAnalyticalBatch.java:29)
> Caused by: java.lang.reflect.InvocationTargetException
> at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:373)
> at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:218)
> ... 28 more
> Caused by: java.lang.NoClassDefFoundError: myplugin/IMyBusinessTransactionExtension
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
> ... 33 more
--
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
18 years, 3 months
[Hibernate-JIRA] Created: (HBX-989) org.hibernate.MappingException: An AnnotationConfiguration instance is required to use <mapping class="any generated class">
by Dariusz jutrowski (JIRA)
org.hibernate.MappingException: An AnnotationConfiguration instance is required to use <mapping class="any generated class">
----------------------------------------------------------------------------------------------------------------------------
Key: HBX-989
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-989
Project: Hibernate Tools
Issue Type: Bug
Components: consoleconfiguration
Affects Versions: 3.2beta10
Environment: hibernate-3.2.5.ga, hibernate-annotations-3.3.0.GA, HibernateTools-3.2.0.beta10, Oracle 9.2.0.8
Reporter: Dariusz jutrowski
I've :
- created hibernate.cfg.xml
- created hibernate console usign hibernate.cfg.xml
- used console to create code generator
- used generator to create java class from jdbc connection (Domain generator) and to insert its definitions in hibernate.cfg.xml (with enabled options "Use Java 5 syntax" and "Generate EJB3 annotations")
Next, when I'm trying to open console (Create Session Factory or double-click) I'm getting an exception :
org.hibernate.MappingException: An AnnotationConfiguration instance is required to use <mapping class="pl.com.pentacomp.kpp.daj.SourceInterfaceVersions"/>
This exception raises if references to any generated class appears in hibernate.cfg.xml.
It seems Hibernate Tools doesn't see hibernate-annotations.jar (or hibernate-commons-annotations.jar) - but generator does !
I was trying to include directy this library into classpath in console definition but with no success.
I'm very astonish because I've repeated all described above operations in new separate Eclipse project (only to test Hibernate Tools) and I have no problems with console (everything was OK).
It means Hibenate Tools behaviour is not deterministic?
Any idea how to solve this problem (I need to have working console in main project) ?
--
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
18 years, 3 months