You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(32) |
Jun
(175) |
Jul
(209) |
Aug
(302) |
Sep
(287) |
Oct
(339) |
Nov
(314) |
Dec
(329) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(479) |
Feb
(389) |
Mar
(599) |
Apr
(307) |
May
(390) |
Jun
(300) |
Jul
(410) |
Aug
(458) |
Sep
(299) |
Oct
(315) |
Nov
(363) |
Dec
(529) |
2005 |
Jan
(568) |
Feb
(434) |
Mar
(1004) |
Apr
(823) |
May
(767) |
Jun
(763) |
Jul
(854) |
Aug
(862) |
Sep
(560) |
Oct
(853) |
Nov
(763) |
Dec
(731) |
2006 |
Jan
(776) |
Feb
(608) |
Mar
(657) |
Apr
(424) |
May
(559) |
Jun
(440) |
Jul
(448) |
Aug
(58) |
Sep
|
Oct
(17) |
Nov
(16) |
Dec
(8) |
2007 |
Jan
(1) |
Feb
(8) |
Mar
(2) |
Apr
(5) |
May
(3) |
Jun
(3) |
Jul
(3) |
Aug
(16) |
Sep
(10) |
Oct
(4) |
Nov
(4) |
Dec
(4) |
2008 |
Jan
(8) |
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: The S. (JIRA) <no...@at...> - 2006-06-21 15:29:32
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1775?page=comments#action_23371 ] The Shadow commented on HHH-1775: --------------------------------- testing, please ignore > collection batch fetching > ------------------------- > > Key: HHH-1775 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1775 > Project: Hibernate3 > Type: Improvement > Components: core > Reporter: Steve Ebersole > Assignee: Steve Ebersole > Priority: Minor > Fix For: 3.2.0 > > > I have code local on my box to support "peeking" into the second level cache when determining whether to add a particular entity/collection key to a batch load request. If the given key is contained in the second level cache, then do not batch fetch the entity/collection as it will be initialized from second level cache on access. > However, there are still large inefficiencies when performing this for collections; the biggest of which currently is the fact that we retreive a IdentityMap.entrySet for each and ever call to determine a collectiomn fetch batch. For performance reasons, we should align this with how entity batches are handled where the entity keys considered to be "batch loadable" are tracked seperately on the BatchFetchQueue. -- 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Thomas K. (JIRA) <no...@at...> - 2006-06-21 12:57:34
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-952?page=all ] Thomas Klaeger updated HHH-952: ------------------------------- Attachment: subquery-patch-313.txt Updated for subversion, Hibernate 3.1.3, unified diff > Patch to allow subqueries with joins using Criteria API and Subqueries with DetachedCriteria > -------------------------------------------------------------------------------------------- > > Key: HHH-952 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-952 > Project: Hibernate3 > Type: Patch > Components: core > Versions: 3.1 beta 1, 3.1 beta 2 > Environment: 3.1beta1 with MS SQL 2000 via jTDS > Reporter: John > Priority: Critical > Attachments: SubqueryExpression.java, subquery-patch-311.txt, subquery-patch-313.txt, subquery-patch-31beta3.txt, subquery-patch.txt, subquery-patch.txt > > > The existing code in SubqueryExpression.java constructed a select statement but did not have any provisions for creating joins. Therefore, it was not possible using the criteria API to create an exists subselect that had a join, even though running the source DetachedCriteria alone works perfectly. > For example, if this is the goal: > select * from foo f > where exists (select id from bar b join other o on b.o_id = o.id where o.prop = '123' and b.foo_id = f.id) > One might try something like this: > Criteria crit = session.createCriteria(Foo.class, fooAlias); > DetachedCriteria barCrit = DetachedCriteria.forClass(Bar.class, barAlias); > DetachedCriteria otherCrit = barCrit.createCriteria(Bar.OTHER_JOIN); > otherCrit.add( Restrictions.eq(Other.PROP, "123") ); > barCrit.add( Restrictions.eqProperty( -- props to join to foo here --) ); > barCrit.setProjection( Projections.id() ); > crit.add( Subqueries.exists(barCrit) ); > However, the existing code generates something like the following, which gets an error with an unknown alias 'o': > select * from foo f > where exists (select id from bar b where o.prop = '123' and b.foo_id = f.id) > This is also described here (at the end): http://forum.hibernate.org/viewtopic.php?t=942488 > The patch to SubqueryExpression.java fixes this to included the joins necessary for the filtering. This code was modeled (copied) off of code from CriteriaLoader. For me this works perfectly, but I don't understand the internals of this stuff enough to say how robust it is. Also included is a patch to the test case to enable testing of this, which was present but commented out. I did not change the contents of the test, which currently only attempts a joined subquery. This used to fail with an error, but now it works. The test does not check the results at all. (Inconsequential to the patch - Enrollment has two Ls.) > -----side notes > The patch file also has two other patches. The first increases the delay in BulkManipulationTest because I was getting inconsistent test results. I think that the precision on the version timestamp is not enough for 300 milliseconds delay to be enough to guarantee the test results. Also, in build.xml, there was a line that was meant to exclude the performance tests, but there was no **/*, on *, so they actually were not excluded. I changed this so the tests would complete in a reasonable amount of time. However, there is one other issue with testing that I worked around manually. After each test run, two databases (Users and Email) were left in the database. If I did not manually delete these then the number of failures on the next test run was different. This was really confusing until I figured it out because I was trying to make sure all the other testcases still passed with my patch, but even without the patch I was getting different results. -- 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: James T. (JIRA) <no...@at...> - 2006-06-21 11:39:30
|
Adds support for including EventListener configuration in hbm2cfgxml -------------------------------------------------------------------- Key: HBX-692 URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-692 Project: Hibernate Tools Type: Patch Components: hbm2java Reporter: James Talmage Priority: Minor Attachments: patch.diff This patch adds support for including <event/> and <listener/> tags in the output generated from hbm2cfgxml. By default the feature is turned off (for backward compatibility). When enabled, it only outputs information on the listeners that differ from the defaults. A second option allows this filter to be turned off, producing a complete listing of the EventListeners. Usage is as follows: <hibernatetool> .... <hbm2cfgxml eventListeners="true" filterEventListeners="false"/> </hibernatetool> This would print ALL the eventListeners in the configuration to the file. Obviously if the event-listener configuration can't be specified via xml (i.e. it requires programatic configuation), this won't be of much help. I've been using a version of this for a while now and find it quite handy. -- 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Prabhagar (JIRA) <no...@at...> - 2006-06-21 10:25:33
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1777?page=comments#action_23368 ] Prabhagar commented on HHH-1777: -------------------------------- Hi Ranjit, Please add following <property tag> to your configuration file(hibernate.cfg.xml), and then try hope so will works fine. <!-- This is required for weblogic! --> <property name="hibernate.query.factory_class"> org.hibernate.hql.classic.ClassicQueryTranslatorFactory </property> Thanks. > org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken > ------------------------------------------------------------------------------------- > > Key: HHH-1777 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1777 > Project: Hibernate3 > Type: Bug > Versions: 3.1.3 > Environment: Hibernate 3.1.3,mysql-5.0.21-win32,mysql-connector-java-3.0.17-ga,jdk1.4.1_05,Struts 1.1,weblogic 8.1,MyEclipse 4.1.1GA > Reporter: Ranjit Patil > Attachments: AbstractBook.java, Book.hbm.xml, Book.java, BookListAction.java, BookListForm.class, HibernateSessionFactory.java, LibraryManager.java, hibernate.cfg.xml > > > I have two tables book and customer. My index page has two links show book list and Show customer List.Currently I am working on only Book List. It calls BookListAction.java which in turn calls LibraryManager.java in which getAllBooks() has code something like this: > public Book[] getAllBooks() { > /* will hold the books we are going to return later */ > List books = new ArrayList(); > /* a Hibernate session */ > Session session = null; > /* we always need a transaction */ > Transaction tx = null; > /* get session of the current thread */ > session = HibernateSessionFactory.currentSession(); > tx = session.beginTransaction(); > ----------Exception is thrown when the below line of code is executed--------------------- > List tmpBooks = session.createQuery( > "select b from Book as b order by b.author, b.title").list(); > ----------------------------------------------------------------------------------------------------------------- > for (Iterator iter = tmpBooks.iterator(); iter.hasNext();) { > books.add((Book) iter.next()); > } > tx.commit(); > return (Book[]) books.toArray(new Book[0]); > } > In eclipse it runs fine but when i deployed on weblogic i got following error when i clicked the show book list link: > org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken [select b from de.laliluna.library.Book as b order by b.author, b.title] > at org.hibernate.hql.ast.HqlLexer.panic(HqlLexer.java:57) > at antlr.CharScanner.setTokenObjectClass(CharScanner.java:287) > at org.hibernate.hql.ast.HqlLexer.setTokenObjectClass(HqlLexer.java:31) > at antlr.CharScanner.(CharScanner.java:42) > at antlr.CharScanner.(CharScanner.java:51) > at org.hibernate.hql.antlr.HqlBaseLexer.(HqlBaseLexer.java:56) > at org.hibernate.hql.antlr.HqlBaseLexer.(HqlBaseLexer.java:53) > at org.hibernate.hql.antlr.HqlBaseLexer.(HqlBaseLexer.java:50) > at org.hibernate.hql.ast.HqlLexer.(HqlLexer.java:26) > at org.hibernate.hql.ast.HqlParser.getInstance(HqlParser.java:44) > at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:232) > at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:155) > at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:109) > at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:75) > at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:54) > at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:71) > at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133) > at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112) > at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1583) > at de.laliluna.library.bl.LibraryManager.getAllBooks(LibraryManager.java:35) -- 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Noam G. (JIRA) <no...@at...> - 2006-06-21 09:01:37
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1053?page=comments#action_23367 ] Noam Gal commented on HHH-1053: ------------------------------- Maybe I am missing out on something, but I got the same problem so far, and looking at the code inside WebSphereExtendedJTATransactionManager, in the inner-class of TransactionManager, all the methods just throw an UnsupportedOperationException However, when I get back to using the WebSphereTransactionManagerLookup on WS6, it does work. > Exception using JTATransaction (Hibernate3.0.5 & WebSphere 6) > ------------------------------------------------------------- > > Key: HHH-1053 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1053 > Project: Hibernate3 > Type: Bug > Components: core > Versions: 3.0.5 > Environment: Hibernate 3.0.5, IBM WebSphere 6 AS, Spring 1.2.5 > Reporter: Andrey Grebnev > > > I am porting my application AtLeap (https://atleap.dev.java.net) from Hibernate 2.1.8 and Spring 1.1.5 to Hibernate 3.0.5 and Spring 1.2.5. > AtLeap was working correctly under IBM WebSphere 6 AS with following settings: > <property name="hibernate.transaction.factory_class" value="org.hibernate.transaction.JTATransactionFactory"/> > <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.WebSphereTransactionManagerLookup"/> > > However when I have ported AtLeap into Hibernate 3.0.5 and Spring 1.2.5 I have the following error: > [05.10.05 22:12:06:531 GEST] 00000058 Helpers W NMSV0605W: A Reference object looked up from the context > "agrebnevNode01Cell/nodes/agrebnevNode01/servers/server1" with the name "jta/usertransaction" was sent to the JNDI Naming Manager and an exception resulted. Reference data follows: > Reference Factory Class Name: com.ibm.ws.Transaction.JTA.UtxJNDIFactory > Reference Factory Class Location URLs: <null> > Reference Class Name: java.lang.Object > Exception data follows: > javax.naming.ConfigurationException > at com.ibm.ws.Transaction.JTA.UtxJNDIFactory.getObjectInstance(UtxJNDIFactory.java:107) > at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:314) > at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookupExt(Helpers.java:874) > at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookup(Helpers.java:681) > at com.ibm.ws.naming.jndicos.CNContextImpl.cacheLookup(CNContextImpl.java:3489) > at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1755) > at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1737) > at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1444) > at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:1324) > at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:144) > at javax.naming.InitialContext.lookup(InitialContext.java:361) > at org.hibernate.transaction.JTATransaction.begin(JTATransaction.java:58) > at org.hibernate.transaction.JTATransactionFactory.beginTransaction(JTATransactionFactory.java:53) > at org.hibernate.jdbc.JDBCContext.beginTransaction(JDBCContext.java:271) > at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1079) > at org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:42 > 6) > at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatform > TransactionManager.java:281) > at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(Transact > ionAspectSupport.java:217) > at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:89) > at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144) > at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174) > at $Proxy72.findContentPageByUri(Unknown Source) > When I try to set > <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.WebSphereExtendedJTATransactionLookup"/> > I have the following error: > [05.10.05 20:55:28:203 GEST] 00000030 SystemErr R org.springframework.dao.DataAccessResourceFailureExceptio > n: Could not register synchronization with JTA TransactionManager; nested exception is java.lang.UnsupportedOpera > tionException: null > java.lang.UnsupportedOperationException > at org.hibernate.transaction.WebSphereExtendedJTATransactionLookup$TransactionManagerAdapter.getStatus(WebSph > ereExtendedJTATransactionLookup.java:76) > at org.springframework.orm.hibernate3.SessionFactoryUtils.registerJtaSynchronization(SessionFactoryUtils.java > :459) > at org.springframework.orm.hibernate3.SessionFactoryUtils.doGetSession(SessionFactoryUtils.java:356) > at org.springframework.orm.hibernate3.SessionFactoryUtils.getSession(SessionFactoryUtils.java:195) > at com.blandware.atleap.webapp.listener.StartupListener.getSession(StartupListener.java:753) > at com.blandware.atleap.webapp.listener.StartupListener.contextInitialized(StartupListener.java:207) > at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:1355) > at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:371) > at com.ibm.ws.webcontainer.webapp.WebGroup.addWebApplication(WebGroup.java:114) > at com.ibm.ws.webcontainer.VirtualHost.addWebApplication(VirtualHost.java:127) > at com.ibm.ws.webcontainer.WebContainer.addWebApp(WebContainer.java:776) > at com.ibm.ws.webcontainer.WebContainer.addWebApplication(WebContainer.java:729) > at com.ibm.ws.runtime.component.WebContainerImpl.install(WebContainerImpl.java:140) > at com.ibm.ws.runtime.component.WebContainerImpl.start(WebContainerImpl.java:360) > at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1019) > at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java: > 1028) > at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:538) > at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:724) > at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:683) > at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1161) > > However after porting from view point of DBMS my AtLeap application continues work correctly with following application servers: > 1. Apache Tomcat 5.0/5.5 (JDBCTransactionFactory) > 2. Geronimo 1 (JDBCTransactionFactory) > 3. Caucho Resin 3 (JTATransactionFactory, ResinTransactionManagerLookup) > 4. JBoss 4 (JDBCTransactionFactory) > 5. Bea Weblogic 9 (JTATransactionFactory, WeblogicTransactionManagerLookup) > 6. ObjectWeb JOnAS 4 (JDBCTransactionFactory) > 7. SJSAS 8 (JDBCTransactionFactory) > 8. Trifork 4 (JDBCTransactionFactory) > 9. Jetty 5 (JDBCTransactionFactory) > So only IBM Webpshere 6 ceased to work. > Any ideas? -- 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Emmanuel B. (JIRA) <no...@at...> - 2006-06-21 01:47:31
|
[ http://opensource.atlassian.com/projects/hibernate/browse/EJB-199?page=comments#action_23366 ] Emmanuel Bernard commented on EJB-199: -------------------------------------- christian is right, TABLE_PER_CLASS with the root class made abstract is the way to map your requirement. > Polymorphic association to a MappedSuperclass throws exception > -------------------------------------------------------------- > > Key: EJB-199 > URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-199 > Project: Hibernate Entity Manager > Type: Bug > Components: EntityManager > Versions: 3.2.0.cr1 > Environment: Annotations CR1, EntityManager CR1, and Hibernate 3.2 CR2 > Reporter: Markus Junginger > > > I think it should be possible to have polymorphic association to a class annotated as a MappedSuperclass. However, this combination throws an exception. > The class Xyz is a super class for a couple of entity classes: > @MappedSuperclass > public abstract class Xyz{...} > The following association to Xyz does not work (see exception below) > @ManyToOne(fetch = FetchType.LAZY) > @JoinColumns({...}) > private Xyz test; > If it matters, each entity (the sub classes of Xyz) is annotated with > @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS). > Here's the execption: > javax.persistence.PersistenceException: org.hibernate.AnnotationException: @OneToOne or @ManyToOne on play.abc.test references an unknown entity: play.Xyz > at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:196) > at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:114) > at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:37) > at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:27) > ... > Caused by: org.hibernate.AnnotationException: @OneToOne or @ManyToOne on play.abc.test references an unknown entity: play.Xyz > at org.hibernate.cfg.FkSecondPass.doSecondPass(FkSecondPass.java:40) > at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:261) > at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1034) > at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:868) > at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:163) > at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:641) > at org.hibernate.ejb.Ejb3Configuration.createFactory(Ejb3Configuration.java:134) > at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:188) > ... 20 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Emmanuel B. (JIRA) <no...@at...> - 2006-06-21 01:43:32
|
[ http://opensource.atlassian.com/projects/hibernate/browse/EJB-200?page=all ] Emmanuel Bernard resolved EJB-200: ---------------------------------- Resolution: Rejected The javadoc can be found in the EJB 3.0 specification http://www.jcp.org/en/jsr/detail?id=220 The exception is part of the specification > EntityManager.find and Query.getSingleResult must throw not RuntimeException > ---------------------------------------------------------------------------- > > Key: EJB-200 > URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-200 > Project: Hibernate Entity Manager > Type: Improvement > Components: EntityManager > Versions: 3.2.0.cr1 > Reporter: Igor A Tarasov > > > I think it will good improvement for writing code with EntityManager. > As from javadoc of java.lang.RuntimeException citate: > "<code>RuntimeException</code> is the superclass of those exceptions that can be thrown during the normal operation of the Java Virtual Machine. " > Empty result of query is standard situation, but Query.getSingleResult() and EntityManager.find throws javax.persistence.NoResultException, which is subclass of RuntimeException. It will better, if it retun empty or null result, or ever throw subclass of normal (not Runtime) exception. It's hard to handle situation with empty result of query if it throw RuntimeException. > MyEntity e = em.createQuery("....").getSingleResult(); > if (e == null) { > // do some work > } else { > // do another work > } > Using standard pattern from Hibernate documentation in this situation is very and very unconvenient. As shown below, we can fogot to catch NoResultException, because it derived from RuntimeException. > EntityManager em = this.emf.createEntityManager(); > EntityTransaction tx = null; > try { > tx = em.getTransaction(); > // do work > MyEntity e = null; > // we can fogot to catch NoResultException because it RuntimeException > try { > e = em.find(MyEntity.class, id); > } catch (NoResultException ex) { > // not good > } > // commit > tx.commit(); > } catch (RuntimeException ex) { > if (tx != null && tx.isActive()) tx. > } finally { > em.close(); > } -- 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Igor A T. (JIRA) <no...@at...> - 2006-06-21 00:16:34
|
[ http://opensource.atlassian.com/projects/hibernate/browse/EJB-133?page=comments#action_23364 ] Igor A Tarasov commented on EJB-133: ------------------------------------ To: Andrew C. Oliver It is not necessary to argue with developers. if you think, that they are using this code in real big projects, you miss :-) It is better to write wrapper for itself than to wait while developers will understand that it inconveniently ;p) Try this: public static final <T> T query_getSingleResult(Query query, Class<T> clazz) { try { return (T)query.getSingleResult(); } catch (NoResultException ex) { return null; } } or this: public static final <T> T query_getSingleResult(Query query, Class<T> clazz) throws NotRuntimeException { try { return (T)query.getSingleResult(); } catch (NoResultException ex) { throw new NotRuntimeException(ex); } } > getSingleResult throws bogus javax.persistence.NoResultException > ---------------------------------------------------------------- > > Key: EJB-133 > URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-133 > Project: Hibernate Entity Manager > Type: Bug > Versions: 3.1.0.Beta8 > Reporter: Andrew C. Oliver > > > http://jira.jboss.com/jira/browse/EJBTHREE-451 - originally opened as (but is clearly a Hibernate issue) - > This is the code: > /* > * (non-Javadoc) > * > * @see org.jboss.mail.mailbox.MailboxService#getMailboxByAlias(java.lang.String) > */ > @Tx(TxType.REQUIRED) > public Mailbox getMailboxByAlias(String alias) { > emInit(); > String query = "from Mailbox as mbox join fetch mbox.defaultInFolder where mbox.aliases.name=:alias"; > return (Mailbox) session.createQuery(query) > .setParameter("alias", alias).getSingleResult(); > } > It results in this query: > select mailbox0_.id as id4_0_, folder1_.id as id4_1_, mailbox0_.parent_id as parent4_4_0_, mailbox0_.name as name4_0_, mailbox0_.defaultOutFolder_id as defaultO5_4_0_, mailbox0_.defaultInFolder_id as defaultI6_4_0_, folder1_.parent_id as parent4_4_1_, folder1_.name as name4_1_, folder1_.defaultOutFolder_id as defaultO5_4_1_, folder1_.defaultInFolder_id as defaultI6_4_1_, folder1_.TYPE as TYPE4_1_ from Folder mailbox0_ inner join Folder folder1_ on mailbox0_.defaultInFolder_id=folder1_.id, Alias aliases2_ where mailbox0_.TYPE='org.jboss.mail.mailbox.Mailbox' and mailbox0_.id=aliases2_.FOLDER_ID and aliases2_.name= ?; > When the above query is run from the console with the value replacing the ?, a result is returned. The aliases and mailboxes were precreated. However this exception is returned: > Caused by: javax.persistence.NoResultException: No entity found for query > at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:47) > at org.jboss.mail.store.AbstractStore.org$jboss$mail$store$AbstractStore$loadMetaData$aop(AbstractStore.java:181) > at org.jboss.mail.store.AbstractStore$loadMetaData_N999927503220138265.invokeNext()Ljava.lang.Object;(AbstractStore$loadMetaData_N999927503220138265.java:???) > at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126) > at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:196) > at org.jboss.mail.store.AbstractStore$loadMetaData_N999927503220138265.invokeNext()Ljava.lang.Object;(AbstractStore$loadMetaData_N999927503220138265.java:???) > at org.jboss.mail.store.AbstractStore.loadMetaData(Ljava.lang.Long;)Lorg.jboss.mail.store.StoreItemMetaData;(AbstractStore.java:???) > at org.jboss.mail.store.AbstractStore.org$jboss$mail$store$AbstractStore$getStoreItem$aop(AbstractStore.java:87) > at org.jboss.mail.store.AbstractStore$getStoreItem_N5079312968078757045.invokeNext()Ljava.lang.Object;(AbstractStore$getStoreItem_N5079312968078757045.java:???) > at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126) > at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:196) > at org.jboss.mail.store.AbstractStore$getStoreItem_N5079312968078757045.invokeNext()Ljava.lang.Object;(AbstractStore$getStoreItem_N5079312968078757045.java:???) > at org.jboss.mail.store.AbstractStore.getStoreItem(Ljava.lang.Long;)Lorg.jboss.mail.store.StoreItem;(AbstractStore.java:???) > at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source) > at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:87) > at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:638) > at javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:201) > at $Proxy103.getStoreItem(Ljava.lang.Long;)Lorg.jboss.mail.store.StoreItem;(Unknown Source) > at org.jboss.mail.message.StoredMailBody.getItem(StoredMailBody.java:105) > at org.jboss.mail.message.StoredMailBody.getSize(StoredMailBody.java:172) > at org.jboss.mail.mailbox.MessageData.<init>(MessageData.java:119) > at org.jboss.mail.mailhandler.localmailbox.LocalDelivery.org$jboss$mail$mailhandler$localmailbox$LocalDelivery$deliver$aop(LocalDelivery.java:101) > at org.jboss.mail.mailhandler.localmailbox.LocalDelivery.access$1(Lorg.jboss.mail.mailhandler.localmailbox.LocalDelivery;Lorg.jboss.mail.mailbox.MailboxService;Lorg.jboss.mail.message.MailAddress;Lorg.jboss.mail.message.Mail;)S(LocalDelivery.java:???) > at org.jboss.mail.mailhandler.localmailbox.LocalDelivery$deliver_7597238674321613949.invokeNext()Ljava.lang.Object;(LocalDelivery$deliver_7597238674321613949.java:???) > at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79) > at org.jboss.aspects.tx.TxInterceptor$RequiresNew.invoke(TxInterceptor.java:253) > at org.jboss.mail.mailhandler.localmailbox.LocalDelivery$deliver_7597238674321613949.invokeNext()Ljava.lang.Object;(LocalDelivery$deliver_7597238674321613949.java:???) > at org.jboss.mail.mailhandler.localmailbox.LocalDelivery.deliver(Lorg.jboss.mail.mailbox.MailboxService;Lorg.jboss.mail.message.MailAddress;Lorg.jboss.mail.message.Mail;)S(LocalDelivery.java:???) > at org.jboss.mail.mailhandler.localmailbox.LocalDelivery.send(LocalDelivery.java:43) > at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source) > You can find a log demonstrating this on dev09 in /services/specmail directory. it isn't a small log file because debugging was turned up all the way :-) So eric will be bugging me to delete it before long. > Under load when connections timeout this exception is thrown. I suspect that deep down it is a broken socket or similar based SQL exception, but the result is actually threre. The number of them go up as load increases. This has been replicated under Postgresql and Mysql. -- 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Igor A T. (JIRA) <no...@at...> - 2006-06-20 23:34:33
|
EntityManager.find and Query.getSingleResult must throw not RuntimeException ---------------------------------------------------------------------------- Key: EJB-200 URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-200 Project: Hibernate Entity Manager Type: Improvement Components: EntityManager Versions: 3.2.0.cr1 Reporter: Igor A Tarasov I think it will good improvement for writing code with EntityManager. As from javadoc of java.lang.RuntimeException citate: "<code>RuntimeException</code> is the superclass of those exceptions that can be thrown during the normal operation of the Java Virtual Machine. " Empty result of query is standard situation, but Query.getSingleResult() and EntityManager.find throws javax.persistence.NoResultException, which is subclass of RuntimeException. It will better, if it retun empty or null result, or ever throw subclass of normal (not Runtime) exception. It's hard to handle situation with empty result of query if it throw RuntimeException. MyEntity e = em.createQuery("....").getSingleResult(); if (e == null) { // do some work } else { // do another work } Using standard pattern from Hibernate documentation in this situation is very and very unconvenient. As shown below, we can fogot to catch NoResultException, because it derived from RuntimeException. EntityManager em = this.emf.createEntityManager(); EntityTransaction tx = null; try { tx = em.getTransaction(); // do work MyEntity e = null; // we can fogot to catch NoResultException because it RuntimeException try { e = em.find(MyEntity.class, id); } catch (NoResultException ex) { // not good } // commit tx.commit(); } catch (RuntimeException ex) { if (tx != null && tx.isActive()) tx. } finally { em.close(); } -- 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Vick F. (JIRA) <no...@at...> - 2006-06-20 14:08:34
|
Reverse Engineering from DB to Java: Package ignored if class name specified ---------------------------------------------------------------------------- Key: HBX-691 URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-691 Project: Hibernate Tools Type: Improvement Components: reverse-engineer Versions: 3.1.beta5 Environment: Hibernate 3.0.5 JDK 5 Reporter: Vick Fisher Priority: Minor I'm using Hibernate Tools to reverse engineer tables into hbm and java files. When I specify a class name for a table in reveng.xml, the generated HBM and Java files end up in the base directory instead of in the package specified. I've tried specifying the package in the <table-filter> and in the tools reverse engineering run config. Here's a reduced version of the hibernate.reveng.xml: ------------------------------------------------------------------------------ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-reverse-engineering PUBLIC "-//Hibernate/Hibernate Reverse Engineering DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd" > <hibernate-reverse-engineering> <table-filter match-name="SEC_.*" package="com.teoco.common.security.model" /> <table name="SEC_ROLE" ></table> <table name="SEC_USERS" class="User"></table> </hibernate-reverse-engineering> ------------------------------------------------------------------------------ Running the hibernate code generation on this file sends the "User" files to the default package (no package) while the SecRole files are sent to the specified package. Generated files excerpts: [imports removed below] ------------------------------------------------------------------------------ // default package // Generated Jun 19, 2006 1:15:42 PM by Hibernate Tools 3.1.0.beta5 /** * User generated by hbm2java */ public class User implements java.io.Serializable { ------------------------------------------------------------------------------ versus this for the SecRole class: ------------------------------------------------------------------------------ package com.teoco.common.security.model; // Generated Jun 19, 2006 1:15:42 PM by Hibernate Tools 3.1.0.beta5 /** * SecRole generated by hbm2java */ public class SecRole implements java.io.Serializable { ------------------------------------------------------------------------------ Max mentioned that the improvement might be to append package if there is no dot in the specified class name. -- 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Max R. A. (JIRA) <no...@at...> - 2006-06-20 11:52:30
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-690?pa= ge=3Dall ] =20 Max Rydahl Andersen closed HBX-690: ----------------------------------- Fix Version: 3.2beta6 Resolution: Fixed i have updated cvs to match latest h3.2 svn > Cannot compile Hibernate Tool 3.1 with the latest Hibernate Version > ------------------------------------------------------------------- > > Key: HBX-690 > URL: http://opensource.atlassian.com/projects/hibernate/browse/H= BX-690 > Project: Hibernate Tools > Type: Task > Components: ant > Versions: 3.1.beta5 > Environment: Hibernate 3-2, Windows XP > Reporter: Francois Jean > Fix For: 3.2beta6 > > > When using the code available at: svn co http://anonhibernate.labs.jboss.= com/trunk/HibernateExt > I cannot compile Hibernate Tool because these classes: > import org.hibernate.loader.custom.SQLQueryCollectionReturn; > import org.hibernate.loader.custom.SQLQueryJoinReturn; > import org.hibernate.loader.custom.SQLQueryReturn; > import org.hibernate.loader.custom.SQLQueryRootReturn; > Are not available in the Hibernate-3.2 tree under the same source reposit= ory (http://anonhibernate.labs.jboss.com/trunk/Hibernate3). > However, Hibernate Tool compile well when using the branch Hibernate 3_1 = (http://anonhibernate.labs.jboss.com/branches/Branch_3_1/Hibernate3/). > Where can I found the Hibernate Tool-3.2 (the version presented at JBoss = World - Las Vegas :-) ? > Thanks, > Fran=C3=A7ois J. --=20 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= .jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: <no...@at...> - 2006-06-20 11:11:34
|
@SecondaryTable together with @Inheritance(strategy=3DInheritanceType.JOINE= D) fails ---------------------------------------------------------------------------= ------ Key: ANN-376 URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN= -376 Project: Hibernate Annotations Type: Bug Versions: 3.2.0.cr1 =20 Environment: Hibernate 3.2.0.cr2 included in JBoss4.0.4GA, MySQL 5 Reporter: Andr=C3=A9 J. Rogger Persister of JoinedSubclassEntity fails together with secondary table annot= ation (the other inheritence strategies are working fine). For example with the following two classes A and B: [A.java] @Entity @SecondaryTable(name=3D"C") @Inheritance(strategy=3DInheritanceType.JOINED) public class A { =09@Id =09long id; =09 =09@Column(table=3D"C") =09String fieldInC; } [B.java] @Entity public class B extends A { =09String fieldOfB; } the deployment produces the following error: org.hibernate.AssertionFailure: Table C not found =09at org.hibernate.persister.entity.JoinedSubclassEntityPersister.getTable= Id(JoinedSubclassEntityPersister.java:444) =09at org.hibernate.persister.entity.JoinedSubclassEntityPersister.<init>(J= oinedSubclassEntityPersister.java:225) =09at org.hibernate.persister.PersisterFactory.createClassPersister(Persist= erFactory.java:58) ... --=20 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= .jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Max R. A. (JIRA) <no...@at...> - 2006-06-20 09:48:33
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-690?pag= e=3Dcomments#action_23362 ]=20 Max Rydahl Andersen commented on HBX-690: ----------------------------------------- from the nightly builds > Cannot compile Hibernate Tool 3.1 with the latest Hibernate Version > ------------------------------------------------------------------- > > Key: HBX-690 > URL: http://opensource.atlassian.com/projects/hibernate/browse/H= BX-690 > Project: Hibernate Tools > Type: Task > Components: ant > Versions: 3.1.beta5 > Environment: Hibernate 3-2, Windows XP > Reporter: Francois Jean > > > When using the code available at: svn co http://anonhibernate.labs.jboss.= com/trunk/HibernateExt > I cannot compile Hibernate Tool because these classes: > import org.hibernate.loader.custom.SQLQueryCollectionReturn; > import org.hibernate.loader.custom.SQLQueryJoinReturn; > import org.hibernate.loader.custom.SQLQueryReturn; > import org.hibernate.loader.custom.SQLQueryRootReturn; > Are not available in the Hibernate-3.2 tree under the same source reposit= ory (http://anonhibernate.labs.jboss.com/trunk/Hibernate3). > However, Hibernate Tool compile well when using the branch Hibernate 3_1 = (http://anonhibernate.labs.jboss.com/branches/Branch_3_1/Hibernate3/). > Where can I found the Hibernate Tool-3.2 (the version presented at JBoss = World - Las Vegas :-) ? > Thanks, > Fran=C3=A7ois J. --=20 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= .jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Christian B. (JIRA) <no...@at...> - 2006-06-20 08:59:32
|
[ http://opensource.atlassian.com/projects/hibernate/browse/EJB-199?page=comments#action_23361 ] Christian Bauer commented on EJB-199: ------------------------------------- So use TABLE_PER_CLASS for your abstract classes and you get what you want with the same schema. > Polymorphic association to a MappedSuperclass throws exception > -------------------------------------------------------------- > > Key: EJB-199 > URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-199 > Project: Hibernate Entity Manager > Type: Bug > Components: EntityManager > Versions: 3.2.0.cr1 > Environment: Annotations CR1, EntityManager CR1, and Hibernate 3.2 CR2 > Reporter: Markus Junginger > > > I think it should be possible to have polymorphic association to a class annotated as a MappedSuperclass. However, this combination throws an exception. > The class Xyz is a super class for a couple of entity classes: > @MappedSuperclass > public abstract class Xyz{...} > The following association to Xyz does not work (see exception below) > @ManyToOne(fetch = FetchType.LAZY) > @JoinColumns({...}) > private Xyz test; > If it matters, each entity (the sub classes of Xyz) is annotated with > @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS). > Here's the execption: > javax.persistence.PersistenceException: org.hibernate.AnnotationException: @OneToOne or @ManyToOne on play.abc.test references an unknown entity: play.Xyz > at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:196) > at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:114) > at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:37) > at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:27) > ... > Caused by: org.hibernate.AnnotationException: @OneToOne or @ManyToOne on play.abc.test references an unknown entity: play.Xyz > at org.hibernate.cfg.FkSecondPass.doSecondPass(FkSecondPass.java:40) > at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:261) > at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1034) > at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:868) > at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:163) > at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:641) > at org.hibernate.ejb.Ejb3Configuration.createFactory(Ejb3Configuration.java:134) > at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:188) > ... 20 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Markus J. (JIRA) <no...@at...> - 2006-06-20 08:52:35
|
[ http://opensource.atlassian.com/projects/hibernate/browse/EJB-199?page=comments#action_23360 ] Markus Junginger commented on EJB-199: -------------------------------------- I agree with you in terms of JSR-220 (section 2.1.9.2 Mapped Superclasses: A class designated as MappedSuperclass has no separate table defined for it.) Nevertheless, I think this feature would make perfectly sense. We have several abstract classes that are NOT mapped to tables, but sub classes have their table counterparts. Background: I am working on a big migration project (including an homegrown ORM tool to be replaced) and without this feature we probably do not let Hibernate/EJB3.0 manage relationships. > Polymorphic association to a MappedSuperclass throws exception > -------------------------------------------------------------- > > Key: EJB-199 > URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-199 > Project: Hibernate Entity Manager > Type: Bug > Components: EntityManager > Versions: 3.2.0.cr1 > Environment: Annotations CR1, EntityManager CR1, and Hibernate 3.2 CR2 > Reporter: Markus Junginger > > > I think it should be possible to have polymorphic association to a class annotated as a MappedSuperclass. However, this combination throws an exception. > The class Xyz is a super class for a couple of entity classes: > @MappedSuperclass > public abstract class Xyz{...} > The following association to Xyz does not work (see exception below) > @ManyToOne(fetch = FetchType.LAZY) > @JoinColumns({...}) > private Xyz test; > If it matters, each entity (the sub classes of Xyz) is annotated with > @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS). > Here's the execption: > javax.persistence.PersistenceException: org.hibernate.AnnotationException: @OneToOne or @ManyToOne on play.abc.test references an unknown entity: play.Xyz > at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:196) > at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:114) > at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:37) > at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:27) > ... > Caused by: org.hibernate.AnnotationException: @OneToOne or @ManyToOne on play.abc.test references an unknown entity: play.Xyz > at org.hibernate.cfg.FkSecondPass.doSecondPass(FkSecondPass.java:40) > at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:261) > at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1034) > at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:868) > at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:163) > at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:641) > at org.hibernate.ejb.Ejb3Configuration.createFactory(Ejb3Configuration.java:134) > at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:188) > ... 20 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Francois J. (JIRA) <no...@at...> - 2006-06-20 02:38:31
|
Cannot compile Hibernate Tool 3.1 with the latest Hibernate Version ------------------------------------------------------------------- Key: HBX-690 URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX= -690 Project: Hibernate Tools Type: Task Components: ant =20 Versions: 3.1.beta5 =20 Environment: Hibernate 3-2, Windows XP Reporter: Francois Jean When using the code available at: svn co http://anonhibernate.labs.jboss.co= m/trunk/HibernateExt I cannot compile Hibernate Tool because these classes: import org.hibernate.loader.custom.SQLQueryCollectionReturn; import org.hibernate.loader.custom.SQLQueryJoinReturn; import org.hibernate.loader.custom.SQLQueryReturn; import org.hibernate.loader.custom.SQLQueryRootReturn; Are not available in the Hibernate-3.2 tree under the same source repositor= y (http://anonhibernate.labs.jboss.com/trunk/Hibernate3). However, Hibernate Tool compile well when using the branch Hibernate 3_1 (h= ttp://anonhibernate.labs.jboss.com/branches/Branch_3_1/Hibernate3/). Where can I found the Hibernate Tool-3.2 (the version presented at JBoss Wo= rld - Las Vegas :-) ? Thanks, Fran=C3=A7ois J. --=20 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= .jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Emmanuel B. (JIRA) <no...@at...> - 2006-06-20 02:09:32
|
[ http://opensource.atlassian.com/projects/hibernate/browse/EJB-199?page=all ] Emmanuel Bernard resolved EJB-199: ---------------------------------- Resolution: Rejected Nope that's expected Only entities can be associated to each other an mapped superclass is not an entity > Polymorphic association to a MappedSuperclass throws exception > -------------------------------------------------------------- > > Key: EJB-199 > URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-199 > Project: Hibernate Entity Manager > Type: Bug > Components: EntityManager > Versions: 3.2.0.cr1 > Environment: Annotations CR1, EntityManager CR1, and Hibernate 3.2 CR2 > Reporter: Markus Junginger > > > I think it should be possible to have polymorphic association to a class annotated as a MappedSuperclass. However, this combination throws an exception. > The class Xyz is a super class for a couple of entity classes: > @MappedSuperclass > public abstract class Xyz{...} > The following association to Xyz does not work (see exception below) > @ManyToOne(fetch = FetchType.LAZY) > @JoinColumns({...}) > private Xyz test; > If it matters, each entity (the sub classes of Xyz) is annotated with > @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS). > Here's the execption: > javax.persistence.PersistenceException: org.hibernate.AnnotationException: @OneToOne or @ManyToOne on play.abc.test references an unknown entity: play.Xyz > at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:196) > at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:114) > at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:37) > at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:27) > ... > Caused by: org.hibernate.AnnotationException: @OneToOne or @ManyToOne on play.abc.test references an unknown entity: play.Xyz > at org.hibernate.cfg.FkSecondPass.doSecondPass(FkSecondPass.java:40) > at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:261) > at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1034) > at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:868) > at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:163) > at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:641) > at org.hibernate.ejb.Ejb3Configuration.createFactory(Ejb3Configuration.java:134) > at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:188) > ... 20 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Corey G. (JIRA) <no...@at...> - 2006-06-19 21:56:33
|
Collection of subclassed objects includes objects with wrong discriminator type ------------------------------------------------------------------------------- Key: HHH-1846 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1846 Project: Hibernate3 Type: Bug Components: core Versions: 3.1.3 Environment: Hibernate 3.1.3, MySQL 4.1.16 Reporter: Corey Gerritsen We have a class that has a set of a subclass of another class... I.e., MyClass.hbm.xml: <class name="MyClass" table="myclass"> ... <set name="mySet" table="my_class_link_some_subclass"> <key column="my_class_id"/> <many-to-many column="some_subclass_id" class="SomeSubclass" /> </set> </class> /MyClass.hbm.xml SomeClass.hbm.xml: <class name="SomeClass" table="someclass"> <id name="id" column="id" type="long"> <generator class="identity"/> </id> <discriminator column="type" type="string" /> ... <subclass name="SomeSubclass" discriminator-value="SOMESUBCLASS"> ... </subclass> <subclass name="AnotherSubclass" descriminator-value="ANOTHERSUBCLASS"> ... </subclass> </class> /SomeClass.hbm.xml When the many-to-many from MyClass to SomeSubclass is fetch="join" (the default), the Set contains SomeSubclass objects that were initialized by rows with either type='SOMESUBCLASS' or type='ANOTHERSUBCLASS', not only those with type='SOMESUBCLASS' This isn't the actual way we found this bug - this also affects caching: we had the collection cached, and when an individual element of the collection expires from the cache, Hibernate tries to reload it by id and descriminator, and can't find elements that shouldn't have been loaded in the first place, throwing, for example, this trace: org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [SomeSubclass#42] at org.hibernate.ObjectNotFoundException.throwIfNull(ObjectNotFoundException.java:27) at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:128) at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:177) at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:87) at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:862) at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:830) 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:1676) at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:344) at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86) at org.hibernate.collection.PersistentSet.iterator(PersistentSet.java:138) ...etc. (we were iterating over the Set of SomeSubclass objects) Note that when this happens, SomeClass.mySet contains a reference to a SomeSubclass with id 42, the database has a row in someclass with id = 42 and type = 'ANOTHERSUBCLASS' -- 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Michael S. (JIRA) <no...@at...> - 2006-06-19 18:21:47
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1725?page=comments#action_23358 ] Michael Small commented on HHH-1725: ------------------------------------ Steve: Have you found a solution to your problem yet? I'm doing the exact same thing (update event listener for Lucene), and it's really annoying. Thanks, Mike > lazy properties, events and collection xxx was not processed by flush exception and EJB3 incompatibility > -------------------------------------------------------------------------------------------------------- > > Key: HHH-1725 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1725 > Project: Hibernate3 > Type: Bug > Components: core > Versions: 3.2.0.cr2 > Reporter: Tomasz Bech > > > It is realted to anomaly: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1540 > 'When using custom event listeners, sometimes you mess with (and initialize) lazy collections by mistake, which causes CollectionEntry.postFlush(PersistentCollection) to throw an AssertionFailure' > It is questionable why AT ALL exception is raised in this case! > What is the most important: EJB3 spec is not prohibiting to check/read/ object involved in the event, so current implementation is agains EJB3 spec. > Events are often used for validation so it is quite probable that the lazy property (collection) has to be accessed - and when it is lazy and not initialized before the exception is raised. Why hibernate cannot treat it in nicer way and allow such actions. > One workaround is to not-use-lazy (very bad). > Second workaround: in the code outside flush (not in event) pre-initialize all lazy properties (in fact simulation of 'not-lazy). -- 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Markus J. (JIRA) <no...@at...> - 2006-06-19 15:34:33
|
Polymorphic association to a MappedSuperclass throws exception -------------------------------------------------------------- Key: EJB-199 URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-199 Project: Hibernate Entity Manager Type: Bug Components: EntityManager Versions: 3.2.0.cr1 Environment: Annotations CR1, EntityManager CR1, and Hibernate 3.2 CR2 Reporter: Markus Junginger I think it should be possible to have polymorphic association to a class annotated as a MappedSuperclass. However, this combination throws an exception. The class Xyz is a super class for a couple of entity classes: @MappedSuperclass public abstract class Xyz{...} The following association to Xyz does not work (see exception below) @ManyToOne(fetch = FetchType.LAZY) @JoinColumns({...}) private Xyz test; If it matters, each entity (the sub classes of Xyz) is annotated with @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS). Here's the execption: javax.persistence.PersistenceException: org.hibernate.AnnotationException: @OneToOne or @ManyToOne on play.abc.test references an unknown entity: play.Xyz at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:196) at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:114) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:37) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:27) ... Caused by: org.hibernate.AnnotationException: @OneToOne or @ManyToOne on play.abc.test references an unknown entity: play.Xyz at org.hibernate.cfg.FkSecondPass.doSecondPass(FkSecondPass.java:40) at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:261) at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1034) at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:868) at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:163) at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:641) at org.hibernate.ejb.Ejb3Configuration.createFactory(Ejb3Configuration.java:134) at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:188) ... 20 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Christian B. (JIRA) <no...@at...> - 2006-06-19 12:32:31
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1397?pa= ge=3Dcomments#action_23357 ]=20 Christian Bauer commented on HHH-1397: -------------------------------------- This is not primary functionality. The regular Hibernate developers are cur= rently busy with other things. If you want to see this fixed quicker, submi= t a patch. > HQL insert into ... select ... statement problem due to lacking table ali= ases in select clause > -------------------------------------------------------------------------= --------------------- > > Key: HHH-1397 > URL: http://opensource.atlassian.com/projects/hibernate/browse/H= HH-1397 > Project: Hibernate3 > Type: Bug > Components: query-hql > Versions: 3.1.1 > Environment: 3.1.1., PostgresSQL > Reporter: Lukas Barton > > > I have got problem with INSERT INTO ... SELECT ... > As I have very complex table stucture and join many tables easy workaroun= d is not possible :-( > I have SQL like this: > insert into IdfKlient (dotazID,tabulkaVSabloneID,obec,status,metaTypKlien= ta,ulice,ic,psc,rc,jmeno,idKlient) select dotaz.id,sablonaMain.id,dtaklient= .obec,dtaklient.status,dtaklient.metaTypKlienta,dtaklient.ulice,dtaklient.i= c,dtaklient.psc,dtaklient.rc,dtaklient.jmeno,dtaklient.idKlient from DtaKli= ent as dtaklient,Dotaz as dotaz,TabulkaVSablone as sablonaMain, HodnotaPara= metruDotazuString parametr_0 where sablonaMain.id=3D:sablona_id and exists(= from Sablona as sablona where dotaz.sablona=3Dsablona and sablona.hlavniTab= ulka=3DsablonaMain and exists(from IdfDavka as davka where dotaz.davka=3Dda= vka and davka.status=3D:status)) and parametr_0.dotaz=3Ddotaz and dtaklient= .rc=3Dparametr_0.hodnota and exists (from Parametr as param where param=3Dp= arametr_0.parametr) > But hibernate translates it into this (see where at the and of statement = - where idsablona=3Did and hlavnitabulka=3Didtabulkavsablone......): > insert into idfklient ( dotaz_id, sablona_id, obec, status, metatypklient= a_id, ulice, ic, psc, rc, jmeno, idklient ) select dotaz1_.id as col_0_0_, = tabulkavsa2_.idtabulkavsablone as col_1_0_, dtaklient0_.obec as col_2_0_, d= taklient0_.status as col_3_0_, dtaklient0_.metatypklienta_id as col_4_0_, d= taklient0_.ulice as col_5_0_, dtaklient0_.ic as col_6_0_, dtaklient0_.psc a= s col_7_0_, dtaklient0_.rc as col_8_0_, dtaklient0_.jmeno as col_9_0_, dtak= lient0_.idklient as col_10_0_ from dtaklient dtaklient0_, dotaz dotaz1_, ta= bulkavsablone tabulkavsa2_, hodnotaparametrudotazustring hodnotapar3_ inner= join hodnotaparametrudotazu hodnotapar3_1_ on hodnotapar3_.idhodnoty=3Dhod= notapar3_1_.id where idtabulkavsablone=3D? and (exists (select sablona4_.id= from sablona sablona4_ where idsablona=3Did and hlavnitabulka=3Didtabulkav= sablone and (exists (select idfdavka5_.ID from IDFDAVKA idfdavka5_ where id= davky=3DID and STATUS=3D?)))) and iddotazu=3Did and rc=3Dhodnota and (exist= s (select parametr6_.id from parametr parametr6_ where id=3Didparametru)) > I found similar error here: http://opensource2.atlassian.com/projects/hib= ernate/browse/HHH-1349 --=20 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= .jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Matan (JIRA) <no...@at...> - 2006-06-19 12:10:32
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1397?pa= ge=3Dcomments#action_23356 ]=20 Matan commented on HHH-1397: ---------------------------- My workaround is direct SQL (yuck!).... only thing that avoids the performa= nce bottleneck. Surprised we aren't getting any feedback from the team though... > HQL insert into ... select ... statement problem due to lacking table ali= ases in select clause > -------------------------------------------------------------------------= --------------------- > > Key: HHH-1397 > URL: http://opensource.atlassian.com/projects/hibernate/browse/H= HH-1397 > Project: Hibernate3 > Type: Bug > Components: query-hql > Versions: 3.1.1 > Environment: 3.1.1., PostgresSQL > Reporter: Lukas Barton > > > I have got problem with INSERT INTO ... SELECT ... > As I have very complex table stucture and join many tables easy workaroun= d is not possible :-( > I have SQL like this: > insert into IdfKlient (dotazID,tabulkaVSabloneID,obec,status,metaTypKlien= ta,ulice,ic,psc,rc,jmeno,idKlient) select dotaz.id,sablonaMain.id,dtaklient= .obec,dtaklient.status,dtaklient.metaTypKlienta,dtaklient.ulice,dtaklient.i= c,dtaklient.psc,dtaklient.rc,dtaklient.jmeno,dtaklient.idKlient from DtaKli= ent as dtaklient,Dotaz as dotaz,TabulkaVSablone as sablonaMain, HodnotaPara= metruDotazuString parametr_0 where sablonaMain.id=3D:sablona_id and exists(= from Sablona as sablona where dotaz.sablona=3Dsablona and sablona.hlavniTab= ulka=3DsablonaMain and exists(from IdfDavka as davka where dotaz.davka=3Dda= vka and davka.status=3D:status)) and parametr_0.dotaz=3Ddotaz and dtaklient= .rc=3Dparametr_0.hodnota and exists (from Parametr as param where param=3Dp= arametr_0.parametr) > But hibernate translates it into this (see where at the and of statement = - where idsablona=3Did and hlavnitabulka=3Didtabulkavsablone......): > insert into idfklient ( dotaz_id, sablona_id, obec, status, metatypklient= a_id, ulice, ic, psc, rc, jmeno, idklient ) select dotaz1_.id as col_0_0_, = tabulkavsa2_.idtabulkavsablone as col_1_0_, dtaklient0_.obec as col_2_0_, d= taklient0_.status as col_3_0_, dtaklient0_.metatypklienta_id as col_4_0_, d= taklient0_.ulice as col_5_0_, dtaklient0_.ic as col_6_0_, dtaklient0_.psc a= s col_7_0_, dtaklient0_.rc as col_8_0_, dtaklient0_.jmeno as col_9_0_, dtak= lient0_.idklient as col_10_0_ from dtaklient dtaklient0_, dotaz dotaz1_, ta= bulkavsablone tabulkavsa2_, hodnotaparametrudotazustring hodnotapar3_ inner= join hodnotaparametrudotazu hodnotapar3_1_ on hodnotapar3_.idhodnoty=3Dhod= notapar3_1_.id where idtabulkavsablone=3D? and (exists (select sablona4_.id= from sablona sablona4_ where idsablona=3Did and hlavnitabulka=3Didtabulkav= sablone and (exists (select idfdavka5_.ID from IDFDAVKA idfdavka5_ where id= davky=3DID and STATUS=3D?)))) and iddotazu=3Did and rc=3Dhodnota and (exist= s (select parametr6_.id from parametr parametr6_ where id=3Didparametru)) > I found similar error here: http://opensource2.atlassian.com/projects/hib= ernate/browse/HHH-1349 --=20 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= .jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Anthony P. (JIRA) <no...@at...> - 2006-06-19 10:38:34
|
polymorphic aggregation is broken --------------------------------- Key: HHH-1845 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1845 Project: Hibernate3 Type: Bug Components: core Versions: 3.2.0.cr2 Reporter: Anthony Patricio Attachments: DomesticAnimalForAggregateTest.hbm.xml, PolymorphicAggregationTest.java Dog and Cat extend DomesticAnimal (mapped with Table per class hierarchy) DomesticalAnimal and Human extend Animal (Animal is not mapped, Human mapped as a Entity) Select count (distinct id) from org.hibernate.test.hql.Animal isn't working even if generated queries are ok. I've attached 2 files: PolymorphicAggregationTest.java DomesticAnimalForAggregateTest.hbm.xml must copy these files into org.hibernate.test.hql package. Also update support case if a fix is planned. https://na1.salesforce.com/50030000002TpbeAAC Anthony -- 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Valentin C. (JIRA) <no...@at...> - 2006-06-19 10:27:33
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HB-156?page=comments#action_23355 ] Valentin Chira commented on HB-156: ----------------------------------- the where helps you only if your value is hardcoded. but what if for example in the where i wanna write something dinamicaly generated like where CLASS_NAME = "<here insert the class name>" or in the value I wanna have the result of some static method call. Does this work? the idea is that i don't want to load all elements in the relation table but only the ones that have some column value like some dinamic value.thx. > Qualified one-to-many > --------------------- > > Key: HB-156 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HB-156 > Project: Hibernate2 > Type: New Feature > Versions: 2.0.1 > Reporter: TURIN ACCOUNT > Priority: Minor > > > Ability to add static criteria to what would otherwise be a one-to-many relationship, to > make it into a one-to-one relationship. Example: Account has one-to-many relationship to > Address by way of address.account_id foreign key. However, there is only one "primary" > address for a given account, indicated in the datamodel by address.is_primary = 'Y' for > exactly one row for any given Account. Enhancement would let me create a property > "primaryAddress" on Account that is mapped like a one-to-many except that it also includes > something like "...AND primary = true". > > This allows me to obtain an Account object and call getPrimaryAddress and have that SQL > query the address table "WHERE account_id = ? AND is_primary = 'Y'". > -- 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: howard b. (JIRA) <no...@at...> - 2006-06-19 09:27:32
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1397?pa= ge=3Dcomments#action_23354 ]=20 howard branch commented on HHH-1397: ------------------------------------ I also have this problem and I have no way round it except iterating throug= h potentially thousands of queries on a production system. Please could we have an ETA for a fix? http://forum.hibernate.org/viewtopic.php?t=3D960800 > HQL insert into ... select ... statement problem due to lacking table ali= ases in select clause > -------------------------------------------------------------------------= --------------------- > > Key: HHH-1397 > URL: http://opensource.atlassian.com/projects/hibernate/browse/H= HH-1397 > Project: Hibernate3 > Type: Bug > Components: query-hql > Versions: 3.1.1 > Environment: 3.1.1., PostgresSQL > Reporter: Lukas Barton > > > I have got problem with INSERT INTO ... SELECT ... > As I have very complex table stucture and join many tables easy workaroun= d is not possible :-( > I have SQL like this: > insert into IdfKlient (dotazID,tabulkaVSabloneID,obec,status,metaTypKlien= ta,ulice,ic,psc,rc,jmeno,idKlient) select dotaz.id,sablonaMain.id,dtaklient= .obec,dtaklient.status,dtaklient.metaTypKlienta,dtaklient.ulice,dtaklient.i= c,dtaklient.psc,dtaklient.rc,dtaklient.jmeno,dtaklient.idKlient from DtaKli= ent as dtaklient,Dotaz as dotaz,TabulkaVSablone as sablonaMain, HodnotaPara= metruDotazuString parametr_0 where sablonaMain.id=3D:sablona_id and exists(= from Sablona as sablona where dotaz.sablona=3Dsablona and sablona.hlavniTab= ulka=3DsablonaMain and exists(from IdfDavka as davka where dotaz.davka=3Dda= vka and davka.status=3D:status)) and parametr_0.dotaz=3Ddotaz and dtaklient= .rc=3Dparametr_0.hodnota and exists (from Parametr as param where param=3Dp= arametr_0.parametr) > But hibernate translates it into this (see where at the and of statement = - where idsablona=3Did and hlavnitabulka=3Didtabulkavsablone......): > insert into idfklient ( dotaz_id, sablona_id, obec, status, metatypklient= a_id, ulice, ic, psc, rc, jmeno, idklient ) select dotaz1_.id as col_0_0_, = tabulkavsa2_.idtabulkavsablone as col_1_0_, dtaklient0_.obec as col_2_0_, d= taklient0_.status as col_3_0_, dtaklient0_.metatypklienta_id as col_4_0_, d= taklient0_.ulice as col_5_0_, dtaklient0_.ic as col_6_0_, dtaklient0_.psc a= s col_7_0_, dtaklient0_.rc as col_8_0_, dtaklient0_.jmeno as col_9_0_, dtak= lient0_.idklient as col_10_0_ from dtaklient dtaklient0_, dotaz dotaz1_, ta= bulkavsablone tabulkavsa2_, hodnotaparametrudotazustring hodnotapar3_ inner= join hodnotaparametrudotazu hodnotapar3_1_ on hodnotapar3_.idhodnoty=3Dhod= notapar3_1_.id where idtabulkavsablone=3D? and (exists (select sablona4_.id= from sablona sablona4_ where idsablona=3Did and hlavnitabulka=3Didtabulkav= sablone and (exists (select idfdavka5_.ID from IDFDAVKA idfdavka5_ where id= davky=3DID and STATUS=3D?)))) and iddotazu=3Did and rc=3Dhodnota and (exist= s (select parametr6_.id from parametr parametr6_ where id=3Didparametru)) > I found similar error here: http://opensource2.atlassian.com/projects/hib= ernate/browse/HHH-1349 --=20 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= .jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |