[Hibernate-JIRA] Commented: (HHH-1851) relax special handling of 'id' property
by Alex Milanovic (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1851?page=c... ]
Alex Milanovic commented on HHH-1851:
-------------------------------------
I am using 3.5.6 and I think I am running into this problem. I call on query.iterate() method and when I try to access the first row in the result set Hibernate complains that it can't find the object. If I understand it correctly, Hibernate first retrieves the IDs and then the actual objects by their ID as one iterates through the list. Now, as my objects have both a property named ID (name="id") and an <id> property Hibernate uses the wrong ID (property named ID instead of the <id> property) and thus ends up not finding the object.
Any clue when the fix might be released?
> relax special handling of 'id' property
> ---------------------------------------
>
> Key: HHH-1851
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1851
> Project: Hibernate Core
> Issue Type: Improvement
> Components: query-hql
> Environment: independent, all versions all databases.
> Reporter: Gunther Schadow
> Assignee: Steve Ebersole
> Fix For: 3.5.x
>
> Attachments: IdClassAndAnotherPropertyNamedId.zip
>
>
> Hibernate has long treated 'id' in a special manner in HQL and Criteria queries. The drawback to this has always been that it effectively means users cannot define non-identifier properties named id and refer to those properties in HQL/Criteria queries.
> Thus, I will change this such that:
> (1) 'id' can still be used to refer to the identifier property, whatever the property's actual name, as long as the entity does not define a non-identitifer property named id.
> (2) if the entity defines a non-identifier property named 'id', using 'id' in HQL or Criteria queries will refer to this non-identifier property; users would need to refer to the identifier property by its actual name.
> FYI, the original reason for this feature was to support entity's which did not define an identifier property at all (users were responsible for managing the ids seperately. That feature was never really recommended and has been deprecated since early in the 3.x development.
--
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
13 years, 8 months
[Hibernate-JIRA] Created: (HHH-5622) Criteria queries incorrectly retrieve associations on FetchMode.JOIN on scroll
by Kyrill Alyoshin (JIRA)
Criteria queries incorrectly retrieve associations on FetchMode.JOIN on scroll
------------------------------------------------------------------------------
Key: HHH-5622
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5622
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.5.4
Reporter: Kyrill Alyoshin
I am really hesitant to submit this bug... It is hard to believe that this is actually happening, but...
Basically, I am using Hibernate core 3.5.4 along with Hibernate Search 3.2.1. I opted to write my own re-indexer (as opposed to using MassIndexer). So, I have an entity called Vendor and it is in bi-directional One-To-Many relationship with an entity called VendorAddress (VendorAddres is not @Indexed). I basically create a criteria query to retrieve all vendors and FetchMode.JOIN their addresses, and reindex them. Pretty straightforward stuff, just want the book "Hibernate Search in Action" says. Here is the code:
{code}
Criteria query = strategy.getQuery(session)
.setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY)
.setCacheMode(CacheMode.IGNORE)
.setFetchSize(reindexBatchSize)
.setFlushMode(FlushMode.MANUAL);
int loggingBatch = 1;
long loggingBatchStart = System.currentTimeMillis();
int counter = 1;
ScrollableResults cursor = null;
try {
cursor = query.scroll(ScrollMode.FORWARD_ONLY);
while (cursor.next()) {
Vendor v = (Vendor) cursor.get(0);
System.out.println("Addresses size is " + v.getAddresses().size());
int count = 0;
for (VendorAddress addr : v.getAddresses()) {
count++;
System.out.println("Address " + count + " is [" + addr + "]");
}
session.index(cursor.get(0));
if (counter++ % reindexBatchSize == 0) {
session.flushToIndexes();
session.clear();
}
if (loggingBatch++ % loggingBatchSize == 0) {
long stop = System.currentTimeMillis();
logger.info("Re-indexed a batch of {} {} entities in {} millis. Total left to re-index: {}.",
new Object[]{
loggingBatchSize, typeName,
(stop - loggingBatchStart), (totalCount - counter + 1)}
);
loggingBatchStart = stop;
}
}
//don't delay to commit time, re-index what's left in a batch immediately
session.flushToIndexes();
session.clear();
}
finally {
//must be closed!
if (cursor != null) {
cursor.close();
}
}
{code}
I have created a integration test that basically creates a Vendor with two addresses, saves it, and re-indexes it. But what happens is that when the scroll runs, it correctly detected that there are two records for Vendor (because of a join) but always retrieves the first address twice!!! Here is the log output from the code above:
{code}
Hibernate:
/* criteria query */ select
this_.vendor_id as vendor1_21_1_,
this_.created_by as created2_21_1_,
this_.created_date as created3_21_1_,
this_.last_modified_by as last4_21_1_,
this_.last_modified_date as last5_21_1_,
this_.centralized_ar_flag as centrali6_21_1_,
this_.enrollment_specialist_id as enrollment9_21_1_,
this_.pm_company_id as pm7_21_1_,
this_.name as name21_1_,
addresses2_.vendor_id as vendor17_21_3_,
addresses2_.addr_id as addr2_3_,
addresses2_.addr_id as addr2_13_0_,
addresses2_.created_by as created3_13_0_,
addresses2_.created_date as created4_13_0_,
addresses2_.last_modified_by as last5_13_0_,
addresses2_.last_modified_date as last6_13_0_,
addresses2_.city as city13_0_,
addresses2_.country_code as country8_13_0_,
addresses2_.addr_line_1 as addr9_13_0_,
addresses2_.addr_line_2 as addr10_13_0_,
addresses2_.addr_line_3 as addr11_13_0_,
addresses2_.postal_code as postal12_13_0_,
addresses2_.state_province_code as state13_13_0_,
addresses2_.vendor_id as vendor17_13_0_,
addresses2_.verified_flag as verified15_13_0_
from
mktg.vendor this_
left outer join
mktg.address addresses2_
on this_.vendor_id=addresses2_.vendor_id
Addresses size is 1
Address 1 is [[VendorAddress@10a063d id = 1]]
Addresses size is 1
Address 1 is [[VendorAddress@10a063d id = 1]]
{code}
So, basically the second address is out of the picture.
Now... The workaround... If I use a simple HQL query and do the same scrolling thing, everything works beautifully:
"from Vendor v left outer join v.addresses"
I believe this to be a critical bug in how Criteria queries handle scrolling.
--
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
13 years, 8 months
[Hibernate-JIRA] Created: (HBX-1068) Hibernate Configurations on Eclipse Ganymede 3.4
by Ricardo M Augusto (JIRA)
Hibernate Configurations on Eclipse Ganymede 3.4
------------------------------------------------
Key: HBX-1068
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-1068
Project: Hibernate Tools
Issue Type: Bug
Components: eclipse
Affects Versions: 3.2.1
Environment: Windows Vista 32bits, hibernate 2.6, eclipse 3.4 (Ganymede)
Reporter: Ricardo M Augusto
When created hibernate configuration eclipse shows:
java.lang.NoClassDefFoundError: org/eclipse/ui/internal/util/SWTResourceUtil
at org.hibernate.eclipse.console.workbench.xpl.AnyAdaptableLabelProvider.getImage(AnyAdaptableLabelProvider.java:166)
at org.eclipse.jface.viewers.WrappedViewerLabelProvider.getImage(WrappedViewerLabelProvider.java:117)
at org.eclipse.jface.viewers.WrappedViewerLabelProvider.update(WrappedViewerLabelProvider.java:165)
at org.eclipse.jface.viewers.ViewerColumn.refresh(ViewerColumn.java:145)
at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:932)
at org.eclipse.jface.viewers.AbstractTreeViewer$UpdateItemSafeRunnable.run(AbstractTreeViewer.java:102)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:1012)
at org.eclipse.jface.viewers.StructuredViewer$UpdateItemSafeRunnable.run(StructuredViewer.java:466)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
at org.eclipse.jface.viewers.StructuredViewer.updateItem(StructuredViewer.java:2041)
at org.eclipse.jface.viewers.AbstractTreeViewer.createTreeItem(AbstractTreeViewer.java:827)
at org.eclipse.jface.viewers.AbstractTreeViewer.createAddedElements(AbstractTreeViewer.java:340)
at org.eclipse.jface.viewers.AbstractTreeViewer.internalAdd(AbstractTreeViewer.java:270)
at org.eclipse.jface.viewers.TreeViewer.internalAdd(TreeViewer.java:652)
at org.hibernate.eclipse.console.viewers.xpl.MTreeViewer.add(MTreeViewer.java:106)
at org.eclipse.ui.progress.DeferredTreeContentManager$3.runInUIThread(DeferredTreeContentManager.java:353)
at org.eclipse.ui.progress.UIJob$1.run(UIJob.java:94)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:133)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3800)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3425)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
--
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
13 years, 8 months
[Hibernate-JIRA] Created: (HV-380) Validator fails when a non-Hibernate persistence layer is in the classpath
by Archie Cobbs (JIRA)
Validator fails when a non-Hibernate persistence layer is in the classpath
--------------------------------------------------------------------------
Key: HV-380
URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-380
Project: Hibernate Validator
Issue Type: Bug
Components: engine
Affects Versions: 4.1.0.Final
Reporter: Archie Cobbs
Assignee: Hardy Ferentschik
Attachments: HIBVALIDBUG.tar.bz2
The documentation for the Hibernate Validator states:
{quote}
The API is not tied to a specific application tier or programming model. It is specifically not tied to either the web tier or the persistence tier, and is available for both server-side application programming, as well as rich client Swing application developer.
{quote}
However, this doesn't seem to be the case. It is true that validation can be performed without any persistence layer being present. However, simply by having a non-Hibernate persistence layer such as EclipseLink in the classpath, validation fails as follows:
{noformat}
javax.validation.ValidationException: Call to TraversableResolver.isReachable() threw an exception
at org.hibernate.validator.engine.ValidatorImpl.isValidationRequired(ValidatorImpl.java:766)
at org.hibernate.validator.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:324)
at org.hibernate.validator.engine.ValidatorImpl.validateConstraintsForRedefinedDefaultGroup(ValidatorImpl.java:273)
at org.hibernate.validator.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:256)
at org.hibernate.validator.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:210)
at org.hibernate.validator.engine.ValidatorImpl.validate(ValidatorImpl.java:119)
at Foo.main(Foo.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152)
at org.apache.tools.ant.taskdefs.Java.run(Java.java:764)
at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:218)
at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:132)
at org.apache.tools.ant.taskdefs.Java.execute(Java.java:105)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
at org.apache.tools.ant.Main.runBuild(Main.java:758)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
Caused by: java.lang.NullPointerException
at javax.persistence.Persistence$1.isLoaded(Persistence.java:78)
at org.hibernate.validator.engine.resolver.JPATraversableResolver.isReachable(JPATraversableResolver.java:62)
at org.hibernate.validator.engine.resolver.DefaultTraversableResolver.isReachable(DefaultTraversableResolver.java:94)
at org.hibernate.validator.engine.resolver.SingleThreadCachedTraversableResolver.isReachable(SingleThreadCachedTraversableResolver.java:47)
at org.hibernate.validator.engine.ValidatorImpl.isValidationRequired(ValidatorImpl.java:757)
... 33 more
{noformat}
I've attached a test case. Run "ant" to see the problem. Edit {{build.xml}} to remove {{eclipselink-1.2.0.jar}} from the runtime classpath, re-run "ant", and the problem goes away.
--
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
13 years, 8 months
[Hibernate-JIRA] Created: (HHH-5614) Reprise of ANN-509: self join class, mapping exception depending on column order
by Chris Wilson (JIRA)
Reprise of ANN-509: self join class, mapping exception depending on column order
--------------------------------------------------------------------------------
Key: HHH-5614
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5614
Project: Hibernate Core
Issue Type: Bug
Components: annotations
Affects Versions: 3.5.6
Environment: M2_REPO/javax/activation/activation/1.1/activation-1.1.jar
M2_REPO/javax/el/el-api/2.2/el-api-2.2.jar
M2_REPO/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar
M2_REPO/javax/servlet/jsp/jsp-api/2.1.2/jsp-api-2.1.2.jar
M2_REPO/javax/transaction/jta/1.1/jta-1.1.jar
M2_REPO/javax/xml/soap/saaj-api/1.3/saaj-api-1.3.jar
M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar
M2_REPO/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar
M2_REPO/javax/validation/validation-api/1.0.0.GA/validation-api-1.0.0.GA.jar
M2_REPO/antlr/antlr/2.7.6/antlr-2.7.6.jar
M2_REPO/aopalliance/aopalliance/1.0/aopalliance-1.0.jar
M2_REPO/org/apache/james/apache-mime4j/0.6/apache-mime4j-0.6.jar
M2_REPO/asm/asm/2.2.3/asm-2.2.3.jar
M2_REPO/org/aspectj/aspectjrt/1.6.2/aspectjrt-1.6.2.jar
M2_REPO/bouncycastle/bcmail-jdk14/138/bcmail-jdk14-138.jar
M2_REPO/org/bouncycastle/bcmail-jdk14/1.38/bcmail-jdk14-1.38.jar
M2_REPO/bouncycastle/bcprov-jdk14/138/bcprov-jdk14-138.jar
M2_REPO/org/bouncycastle/bcprov-jdk14/1.38/bcprov-jdk14-1.38.jar
M2_REPO/org/bouncycastle/bctsp-jdk14/1.38/bctsp-jdk14-1.38.jar
M2_REPO/org/beanshell/bsh/2.0b4/bsh-2.0b4.jar
M2_REPO/c3p0/c3p0/0.9.1/c3p0-0.9.1.jar
M2_REPO/commons-beanutils/commons-beanutils/1.8.2/commons-beanutils-1.8.2.jar
M2_REPO/commons-codec/commons-codec/1.3/commons-codec-1.3.jar
M2_REPO/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar
M2_REPO/commons-digester/commons-digester/1.7/commons-digester-1.7.jar
M2_REPO/commons-io/commons-io/1.4/commons-io-1.4.jar
M2_REPO/commons-lang/commons-lang/2.4/commons-lang-2.4.jar
M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar
M2_REPO/net/sourceforge/cssparser/cssparser/0.9.5/cssparser-0.9.5.jar
M2_REPO/org/apache/cxf/cxf-api/2.2.7/cxf-api-2.2.7.jar
M2_REPO/org/apache/cxf/cxf-common-schemas/2.2.7/cxf-common-schemas-2.2.7.jar
M2_REPO/org/apache/cxf/cxf-common-utilities/2.2.7/cxf-common-utilities-2.2.7.jar
M2_REPO/org/apache/cxf/cxf-rt-bindings-soap/2.2.7/cxf-rt-bindings-soap-2.2.7.jar
M2_REPO/org/apache/cxf/cxf-rt-bindings-xml/2.2.7/cxf-rt-bindings-xml-2.2.7.jar
M2_REPO/org/apache/cxf/cxf-rt-core/2.2.7/cxf-rt-core-2.2.7.jar
M2_REPO/org/apache/cxf/cxf-rt-databinding-aegis/2.2.7/cxf-rt-databinding-aegis-2.2.7.jar
M2_REPO/org/apache/cxf/cxf-rt-databinding-jaxb/2.2.7/cxf-rt-databinding-jaxb-2.2.7.jar
M2_REPO/org/apache/cxf/cxf-rt-frontend-jaxws/2.2.7/cxf-rt-frontend-jaxws-2.2.7.jar
M2_REPO/org/apache/cxf/cxf-rt-frontend-simple/2.2.7/cxf-rt-frontend-simple-2.2.7.jar
M2_REPO/org/apache/cxf/cxf-rt-javascript/2.2.7/cxf-rt-javascript-2.2.7.jar
M2_REPO/org/apache/cxf/cxf-rt-transports-http/2.2.7/cxf-rt-transports-http-2.2.7.jar
M2_REPO/org/apache/cxf/cxf-rt-transports-http-jetty/2.2.7/cxf-rt-transports-http-jetty-2.2.7.jar
M2_REPO/org/apache/cxf/cxf-rt-transports-local/2.2.7/cxf-rt-transports-local-2.2.7.jar
M2_REPO/org/apache/cxf/cxf-rt-ws-addr/2.2.7/cxf-rt-ws-addr-2.2.7.jar
M2_REPO/org/apache/cxf/cxf-tools-common/2.2.7/cxf-tools-common-2.2.7.jar
M2_REPO/org/apache/cxf/cxf-tools-java2ws/2.2.7/cxf-tools-java2ws-2.2.7.jar
M2_REPO/org/apache/cxf/cxf-tools-validator/2.2.7/cxf-tools-validator-2.2.7.jar
M2_REPO/org/apache/cxf/cxf-tools-wsdlto-core/2.2.7/cxf-tools-wsdlto-core-2.2.7.jar
M2_REPO/org/apache/cxf/cxf-tools-wsdlto-databinding-jaxb/2.2.7/cxf-tools-wsdlto-databinding-jaxb-2.2.7.jar
M2_REPO/org/apache/cxf/cxf-tools-wsdlto-frontend-jaxws/2.2.7/cxf-tools-wsdlto-frontend-jaxws-2.2.7.jar
M2_REPO/org/apache/derby/derby/10.6.1.0/derby-10.6.1.0.jar
M2_REPO/org/apache/derby/derbytools/10.6.1.0/derbytools-10.6.1.0.jar
M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar
M2_REPO/org/glassfish/web/el-impl/2.2/el-impl-2.2.jar
M2_REPO/org/springframework/security/facelets-taglib/0.2_jsf-2.0_spring-2/facelets-taglib-0.2_jsf-2.0_spring-2.jar
M2_REPO/freemarker/freemarker/2.3.8/freemarker-2.3.8.jar
M2_REPO/org/apache/geronimo/specs/geronimo-annotation_1.0_spec/1.1.1/geronimo-annotation_1.0_spec-1.1.1.jar
M2_REPO/org/apache/geronimo/javamail/geronimo-javamail_1.4_mail/1.7/geronimo-javamail_1.4_mail-1.7.jar
M2_REPO/org/apache/geronimo/specs/geronimo-jaxws_2.1_spec/1.0/geronimo-jaxws_2.1_spec-1.0.jar
M2_REPO/org/apache/geronimo/specs/geronimo-ws-metadata_2.0_spec/1.1.2/geronimo-ws-metadata_2.0_spec-1.1.2.jar
M2_REPO/org/codehaus/groovy/groovy-all/1.7.5/groovy-all-1.7.5.jar
M2_REPO/org/hibernate/hibernate-annotations/3.5.6-Final/hibernate-annotations-3.5.6-Final.jar
M2_REPO/org/hibernate/hibernate-c3p0/3.5.6-Final/hibernate-c3p0-3.5.6-Final.jar
M2_REPO/org/hibernate/hibernate-commons-annotations/3.2.0.Final/hibernate-commons-annotations-3.2.0.Final.jar
M2_REPO/org/hibernate/hibernate-core/3.5.6-Final/hibernate-core-3.5.6-Final.jar
M2_REPO/org/hibernate/hibernate-entitymanager/3.5.3-Final/hibernate-entitymanager-3.5.3-Final.jar
M2_REPO/org/hibernate/hibernate-envers/3.5.3-Final/hibernate-envers-3.5.3-Final.jar
M2_REPO/org/hibernate/javax/persistence/hibernate-jpa-2.0-api/1.0.0.Final/hibernate-jpa-2.0-api-1.0.0.Final.jar
M2_REPO/org/hibernate/hibernate-tools/3.2.0.ga/hibernate-tools-3.2.0.ga.jar
M2_REPO/org/hibernate/hibernate-validator/4.1.0.Beta1/hibernate-validator-4.1.0.Beta1.jar
M2_REPO/net/sourceforge/htmlunit/htmlunit/2.8/htmlunit-2.8.jar
M2_REPO/net/sourceforge/htmlunit/htmlunit-core-js/2.8/htmlunit-core-js-2.8.jar
M2_REPO/org/apache/httpcomponents/httpclient/4.0.1/httpclient-4.0.1.jar
M2_REPO/org/apache/httpcomponents/httpcore/4.0.1/httpcore-4.0.1.jar
M2_REPO/org/apache/httpcomponents/httpmime/4.0.1/httpmime-4.0.1.jar
M2_REPO/com/lowagie/itext/2.1.7/itext-2.1.7.jar
M2_REPO/net/sf/jasperreports/jasperreports/3.7.2/jasperreports-3.7.2.jar
M2_REPO/javassist/javassist/3.8.0.GA/javassist-3.8.0.GA.jar
M2_REPO/com/sun/xml/bind/jaxb-impl/2.1.12/jaxb-impl-2.1.12.jar
M2_REPO/com/sun/xml/bind/jaxb-xjc/2.1.12/jaxb-xjc-2.1.12.jar
M2_REPO/jfree/jcommon/1.0.15/jcommon-1.0.15.jar
M2_REPO/eclipse/jdtcore/3.1.0/jdtcore-3.1.0.jar
M2_REPO/org/mortbay/jetty/jetty/6.1.21/jetty-6.1.21.jar
M2_REPO/org/eclipse/jetty/jetty-http/7.0.1.v20091125/jetty-http-7.0.1.v20091125.jar
M2_REPO/org/eclipse/jetty/jetty-io/7.0.1.v20091125/jetty-io-7.0.1.v20091125.jar
M2_REPO/org/eclipse/jetty/jetty-util/7.0.1.v20091125/jetty-util-7.0.1.v20091125.jar
M2_REPO/org/mortbay/jetty/jetty-util/6.1.21/jetty-util-6.1.21.jar
M2_REPO/jfree/jfreechart/1.0.12/jfreechart-1.0.12.jar
M2_REPO/com/sun/faces/jsf-api/2.0.2/jsf-api-2.0.2.jar
M2_REPO/com/sun/faces/jsf-impl/2.0.2/jsf-impl-2.0.2.jar
M2_REPO/jstl/jstl/1.2/jstl-1.2.jar
M2_REPO/org/hibernate/jtidy/r8-20060801/jtidy-r8-20060801.jar
M2_REPO/junit/junit/3.8.2/junit-3.8.2.jar
M2_REPO/log4j/log4j/1.2.13/log4j-1.2.13.jar
/rita/lib/migrate/migrate4j-svn-091117.jar
M2_REPO/mysql/mysql-connector-java/5.1.13/mysql-connector-java-5.1.13.jar
M2_REPO/org/apache/neethi/neethi/2.0.4/neethi-2.0.4.jar
M2_REPO/net/sourceforge/nekohtml/nekohtml/1.9.14/nekohtml-1.9.14.jar
M2_REPO/oro/oro/2.0.8/oro-2.0.8.jar
M2_REPO/org/apache/poi/poi/3.6/poi-3.6.jar
M2_REPO/com/sun/xml/messaging/saaj/saaj-impl/1.3.2/saaj-impl-1.3.2.jar
M2_REPO/org/w3c/css/sac/1.3/sac-1.3.jar
M2_REPO/xalan/serializer/2.7.1/serializer-2.7.1.jar
M2_REPO/org/slf4j/slf4j-api/1.5.8/slf4j-api-1.5.8.jar
M2_REPO/org/slf4j/slf4j-log4j12/1.5.8/slf4j-log4j12-1.5.8.jar
M2_REPO/org/springframework/spring-aop/2.0.8/spring-aop-2.0.8.jar
M2_REPO/org/springframework/spring-beans/2.0.8/spring-beans-2.0.8.jar
M2_REPO/org/springframework/spring-context/2.0.8/spring-context-2.0.8.jar
M2_REPO/org/springframework/spring-core/2.0.8/spring-core-2.0.8.jar
M2_REPO/org/springframework/security/spring-security-core/2.0.4/spring-security-core-2.0.4.jar
M2_REPO/org/springframework/spring-support/2.0.8/spring-support-2.0.8.jar
M2_REPO/org/springframework/spring-web/2.0.8/spring-web-2.0.8.jar
M2_REPO/org/apache/velocity/velocity/1.6.2/velocity-1.6.2.jar
M2_REPO/wsdl4j/wsdl4j/1.6.2/wsdl4j-1.6.2.jar
M2_REPO/org/codehaus/woodstox/wstx-asl/3.2.9/wstx-asl-3.2.9.jar
M2_REPO/xalan/xalan/2.7.1/xalan-2.7.1.jar
M2_REPO/xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar
M2_REPO/xml-apis/xml-apis/1.3.02/xml-apis-1.3.02.jar
M2_REPO/xml-resolver/xml-resolver/1.2/xml-resolver-1.2.jar
M2_REPO/org/apache/ws/commons/schema/XmlSchema/1.4.5/XmlSchema-1.4.5.jar
/rita/lib/zxing/zxing13_core.jar
/rita/lib/zxing/zxing13_javase.jar
Reporter: Chris Wilson
Attachments: HibernateJoinSameTableMappingTest.java
The attached test case includes two very similar classes, both of which join to themselves, and to one other class (Shipment) with @ManyToOne.
The configuration succeeds for one, but fails for the other with a MappingException:
org.hibernate.MappingException: Unable to find column with logical name shipment_id in table HibernateJoinSameTableMappingTest$SelfJoinFails
at org.hibernate.cfg.Configuration$MappingsImpl.getPhysicalColumnName(Configuration.java:2733)
at org.hibernate.cfg.BinderHelper.findPropertiesByColumns(BinderHelper.java:257)
at org.hibernate.cfg.BinderHelper.createSyntheticPropertyReference(BinderHelper.java:144)
at org.hibernate.cfg.ToOneFkSecondPass.doSecondPass(ToOneFkSecondPass.java:110)
at org.hibernate.cfg.AnnotationConfiguration.processEndOfQueue(AnnotationConfiguration.java:541)
at org.hibernate.cfg.AnnotationConfiguration.processFkSecondPassInOrder(AnnotationConfiguration.java:523)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:380)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1377)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:954)
at org.wfp.rita.test.hibernate.HibernateJoinSameTableMappingTest.testFailing(HibernateJoinSameTableMappingTest.java:73)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:164)
at junit.framework.TestCase.runBare(TestCase.java:130)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:120)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at junit.framework.TestSuite.run(TestSuite.java:225)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
The only difference between the two classes is the order of the columns in the self join.
I'm suspecting that the order that the annotations are processed in affects whether this works or not. Perhaps because it's a self join, and the necessary columns have not been created when they are used to join the table to itself?
--
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
13 years, 8 months
[Hibernate-JIRA] Created: (HHH-5613) Inheritance relation creates left outer join in stead of inner join btwn child and parent
by Marc Schipperheyn (JIRA)
Inheritance relation creates left outer join in stead of inner join btwn child and parent
-----------------------------------------------------------------------------------------
Key: HHH-5613
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5613
Project: Hibernate Core
Issue Type: Improvement
Components: core
Affects Versions: 3.5.4
Reporter: Marc Schipperheyn
Priority: Minor
I have
@Entity
@Table(name = "Offer")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorValue(value = "OFF")
@DiscriminatorColumn(name = "DTYPE", length = 3)
public class Offer
@Entity
@DiscriminatorValue("JOB")
@SecondaryTable(name="JobOffer", pkJoinColumns =
{
@PrimaryKeyJoinColumn(name = "offerId", referencedColumnName = "offerId")
}
)
public class JobOffer extends Offer
When I run a detached Criteria query
DetachedCriteria dc = DetachedCriteria.forClass(JobOffer.class)
.add(
Restrictions.in("id", ids));
return getHibernateTemplate().findByCriteria(dc);
I see in the query something like this
from Offer this_
left outer join
JobOffer this_1_ on this_.offerID=this_1_.offerId
where this_.DTYPE='JOB' and this_.offerID in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
It would seem to me that it would make more sense to have an inner join here b/c JobOffer is a child of Offer and therefore must have a table relationship. Every row in JobOffer table should have a corresponding row in Offer table.
I would imagine that an outer join performs less than an inner join because the amount of rows evaluated would be less.
--
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
13 years, 8 months
[Hibernate-JIRA] Commented: (HHH-1015) Incorrect SQL generated when one-to-many foreign key is in a discriminated subclass table
by David Balažic (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1015?page=c... ]
David Balažic commented on HHH-1015:
------------------------------------
3.6.0 is around the corner. Is this fixed now?
> Incorrect SQL generated when one-to-many foreign key is in a discriminated subclass table
> -----------------------------------------------------------------------------------------
>
> Key: HHH-1015
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1015
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Affects Versions: 3.1 beta 2, 3.5.1
> Environment: Hibernate versions 3.1 beta 3 and 3.0.5
> Reporter: Steven Grimm
> Priority: Minor
> Attachments: 3.3.2.GA-HHH-1015-v1.patch, hhh-1015-version2.patch, hhh-1015.patch
>
>
> I have the following mappings describing a hierarchy of events and a class that the events refer to:
> <hibernate-mapping package="com.xyz">
> <class name="Event" table="event" discriminator-value="-1">
> <id name="Id" type="long" column="event_id"/>
> <discriminator column="event_type_id" type="integer" />
> <subclass name="EventPayer" discriminator-value="-3">
> <join table="event_payer">
> <key column="event_id" />
> <many-to-one name="payer" column="payer_id" class="Payer" />
> </join>
> <subclass name="EventPayerCreated" discriminator-value="1" />
> </subclass>
> </class>
> <class name="Payer" table="payer">
> <id name="payerId" column="payer_id" type="java.lang.Long"/>
> <set name="eventPayers" inverse="true" cascade="save-update">
> <key column="payer_id"/>
> <one-to-many class="EventPayer"/>
> </set>
> </class>
> </hibernate-mapping>
> When I fetch the Payer.eventPayers collection, Hibernate generates this SQL:
> select eventpayer0_.payer_id as payer7_1_,
> eventpayer0_.event_id as event1_1_,
> eventpayer0_.event_id as event1_5_0_,
> eventpayer0_1_.payer_id as payer2_6_0_,
> eventpayer0_.event_type_id as event2_5_0_
> from event eventpayer0_
> inner join event_payer eventpayer0_1_
> on eventpayer0_.event_id=eventpayer0_1_.event_id
> where eventpayer0_.payer_id=?
> The problem is that there is no event.payer_id column; payer_id is in the child table, not the parent. It appears that specifying a discriminated subclass in <one-to-many> is the same as specifying the superclass, or that Hibernate is ignoring the subclass's <join> element. As far as I can tell, this leaves no way to resolve bidirectional associations where one end of the association is in a discriminated subclass, which seems like a perfectly reasonable thing to want to do.
> I also tried changing <key column="payer_id"/> to <key property-ref="payer"/> in the Payer class's <set> element, but got similar behavior in the form of a "property not found" error: Hibernate is either looking in the superclass's properties rather than the subclass's or is ignoring the list of properties in the <join> element.
--
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
13 years, 8 months