[Hibernate-JIRA] Created: (HHH-3345) "select new" + "join fetch" = "owner of the fetched association was not present in the select list"
by Anthony Ogier (JIRA)
"select new" + "join fetch" = "owner of the fetched association was not present in the select list"
---------------------------------------------------------------------------------------------------
Key: HHH-3345
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3345
Project: Hibernate3
Issue Type: Bug
Affects Versions: 3.2.4.sp1
Reporter: Anthony Ogier
I want to create a List<B>, each B containing an entity with "A" type, and I also want for each A to force fetching of its "C" property.
public class B {
private A a;
public B(A a) {
this.a = a;
}
}
@Entity
public class A {
@ManyToOne @JoinColumn
private C c;
// +get/setter ...
}
@Entity
public class C {
@Column
private String d;
// +get/setter ...
// +@OneToMany
}
Here is the HQL :
select new B(a) from A a left join fetch a.c
I have that message :
org.hibernate.QueryException: query specified join fetching, but the owner of the fetched association was not present in the select list
When invoking only "from A a left join fetch a.c", all is good and I have ma List<A> with its "C" properties fetched.
I think there is a little bug here ... or did I forget something ?
--
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
11 years, 10 months
[Hibernate-JIRA] Created: (HHH-4897) onFlushDirty not called if only modification was to a collection of elements
by Rob West (JIRA)
onFlushDirty not called if only modification was to a collection of elements
----------------------------------------------------------------------------
Key: HHH-4897
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4897
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.3.2, 3.3.1
Reporter: Rob West
Attachments: InterceptorTest.jar
We are not seeing onFlushDirty get called if the only modification to a Hibernate-mapped entity is to a collection of elements (e.g. a Set<String> that maps to entries in a related table). It appears that for purposes of calling onFlushDirty, a collection property of an entity can only be considered dirty if that entity is versioned (it may still not be dirty, but it cannot be dirty unless the entity is versioned). For purposes of actually executing SQL, the collection property is properly considered to be dirty based on a call to PersistentCollection.isDirty(), but this prevents an interceptor from acting on the modifications.
I've attached a jar file that contains (source) modifications to the InterceptorTest to add an additional test case highlighting this, along with modifications to User.java and User.hbm.xml to add an additional collection of elements property. The assertNotNull on line 66 (the check of last updated) fails for me locally with the latest hibernate source downloaded from hibernate.org, which appears to be 3.3.2. We currently use 3.3.1 in production.
My original forum post is at https://forum.hibernate.org/viewtopic.php?f=1&t=1002411, which contains some additional debugging information while I was figuring out what was going on.
As a note: I left the priority here the default. This is a pretty serious issue for us though, as one of the key things we do with interceptors is auditing of changes, and this means that sometimes certain properties do not get audited. We haven't been able to identify any straightforward workaround to implement that is not either fairly invasive or leaves us open to introducing other equally or more serious bugs in our code. Suggestions welcome.
--
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
11 years, 10 months
[Hibernate-JIRA] Created: (ANN-783) DOCS: says, monkey, should say tiger: section 2.2.5.3.2.4. Defaults
by Karl Palsson (JIRA)
DOCS: says, monkey, should say tiger: section 2.2.5.3.2.4. Defaults
-------------------------------------------------------------------
Key: ANN-783
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-783
Project: Hibernate Annotations
Issue Type: Improvement
Components: documentation
Affects Versions: 3.4.0.GA
Environment: http://www.hibernate.org/hib_docs/annotations/reference/en/html_single/
or
http://www.hibernate.org/hib_docs/annotations/reference/en/html/entity.ht...
Reporter: Karl Palsson
Priority: Trivial
Text says:
Trainer describes a unidirectional relationship with Tiger using the join table Trainer_Tiger, with a foreign key trainer_id to Trainer (table name, _, trainer id) and a foreign key trainedTigers_id to Monkey (property name, _, Tiger primary column).
Last reference to Monkey should say Tiger. Monkeys were used in the previous section
--
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
11 years, 10 months