[Hibernate-JIRA] Created: (HCANN-30) EntityBinder: Incorrect WARN message about dynamicUpdate ("Entity used on a non root entity: ignored for...")
by Shahaf Abileah (JIRA)
EntityBinder: Incorrect WARN message about dynamicUpdate ("Entity used on a non root entity: ignored for...")
-------------------------------------------------------------------------------------------------------------
Key: HCANN-30
URL: http://opensource.atlassian.com/projects/hibernate/browse/HCANN-30
Project: Hibernate Commons Annotations
Issue Type: Bug
Reporter: Shahaf Abileah
Priority: Minor
This my first bug so please excuse any mistakes I make in filing it, and help me correct them.
I'm using PostgreSQL. I have a bunch of domain objects. Some of them are small class hierarchies. I chose to map each class hierarchy to a single table using a discriminator column. Here's one example where I have a base class (Note) and a subclass (TaskNote)...
@Entity
@org.hibernate.annotations.Entity(dynamicUpdate = true)
@Table(name = "notes")
@SequenceGenerator(name = "notes_note_id_seq", sequenceName = "notes_note_id_seq", allocationSize = 1)
@Proxy(lazy = true)
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@SQLDelete(sql="update notes set removed = true where note_id = ?")
@DiscriminatorColumn(
name=Note.noteTypeColumnName,
discriminatorType=DiscriminatorType.INTEGER
)
public abstract class Note implements Persistable {
...
}
@Entity
@org.hibernate.annotations.Entity(dynamicUpdate = true)
@Proxy(lazy = true)
@DiscriminatorValue("1")
public class TaskNote extends Note {
...
}
Notice that I added the following annotation to both: @org.hibernate.annotations.Entity(dynamicUpdate = true)
I did this because I want to keep my updates lean.
After adding this annotation I started seeing warnings in my log:
2010-11-01 10:03:22,210 WARN org.hibernate.cfg.annotations.EntityBinder @org.hibernate.annotations.Entity used on a non root entity: ignored for redfin.core.domain.TaskNote
I spent some time experimenting with this annotation to understand how it works with class hierarchies. I discovered that:
* If I put the annotation on the child class and not on the parent class, then I get the WARN but dynamicUpdate still works
* If I put the annotation on the parent class and not the child class, then the WARN goes away but dynamicUpdate does not work
* If I put the annotation on both, then the WARN is there and dynamicUpdate works
To me this implies that the WARN is incorrect. Do you agree?
I believe this is the code that is generating the message:
http://www.docjar.com/html/api/org/hibernate/cfg/annotations/EntityBinder...
Here are the particular versions of the various hibernate libraries that I'm using:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>3.0.0.ga</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>3.2.7.ga</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.3.0.ga</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-commons-annotations</artifactId>
<version>3.3.0.ga</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>antlr</artifactId>
<version>2.7.5H3</version>
</dependency>
--
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: (OGM-134) Fix logs in BasicGridBinder
by Emmanuel Bernard (JIRA)
Fix logs in BasicGridBinder
---------------------------
Key: OGM-134
URL: https://hibernate.onjira.com/browse/OGM-134
Project: Hibernate OGM
Issue Type: Bug
Reporter: Emmanuel Bernard
I have noticed that the BasicGridBinder has a problem when it logs the
bindding ( BasicGridBinder.bind(Tuple, X, String[] ) method).
Actually, the trace is "binding [$s] to parameter(s) $s" but it should be
"binding [thevalue] to parameter(s) theparameter".
It can be fixed easily by modifying the two calls to log.tracef() (line 70
and 76) respectively like that:
log.tracef( "binding [null] to parameter [%1$s]", name );
and
log.tracef( "binding [%1$s] to parameter(s) %2$s",
javaDescriptor.extractLoggableRepresentation( value ), Arrays.toString(
names ) );
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 10 months
[Hibernate-JIRA] Created: (HHH-2666) subselect fetching ignores max results
by James Roper (JIRA)
subselect fetching ignores max results
--------------------------------------
Key: HHH-2666
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2666
Project: Hibernate3
Issue Type: Improvement
Components: query-hql, query-sql
Affects Versions: 3.2.1
Environment: Hibernate 3.2.1
HSQLDB 8.0
Reporter: James Roper
Priority: Minor
When maxResults is set for a query, the hibernate subselect fetching strategy ignores it. For example, I have a class entry, that has a list of comments, which are configured to use the subselect fetching strategy. You can see that in the original query, only the top ? results are fetched:
select
top ? entry0_.id as id0_,
entry0_.title as title0_,
entry0_.entry as entry0_,
entry0_.time as time0_,
entry0_.category_id as category5_0_
from
Entry entry0_
order by
entry0_.time desc
But then when it does the sub select query to lazily load the comments, this is the query it runs:
select
comments0_.entry_id as entry5_1_,
comments0_.id as id1_,
comments0_.id as id1_0_,
comments0_.time as time1_0_,
comments0_.comment as comment1_0_,
comments0_.author as author1_0_
from
Comment comments0_
where
comments0_.entry_id in (
select
entry0_.id
from
Entry entry0_
)
order by
comments0_.time desc
So, it loads every single comment in the database, even though only the comments for the top ? entries are needed. Of course, if there was no order by clause on the first query, the sub select may not return the same results, so it should probably only do this when there is an order by clause in the first query, and it should make sure it includes the order by clause in the sub select.
--
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-609) Need a way to specify "unsaved-value" strategy using annotations
by Suji Suresh (JIRA)
Need a way to specify "unsaved-value" strategy using annotations
----------------------------------------------------------------
Key: ANN-609
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-609
Project: Hibernate Annotations
Issue Type: Bug
Environment: Hibernate 3.2.2, Hibernate-annotations 3.2.1
Reporter: Suji Suresh
Hibernate has two ways of specifying a value for primary key:
1. Assign a value before handing it over to Hibernate
2. Have Hibernate generate the value before persisting
In my project I have objects of both of the above specified types. In other words I assign value for the primary key for some the objects (lets call these objects "assigned") and for others I have Hibernate generate the value before persisting (lets call these objects "generated"). Since Hibernate annotations does not support "unsaved-value", I do not have a way of specifying "unsaved-value" strategy. While my "generated" objects work perfectly with Hibernate's default "unsaved-value" strategy, I see wrong (but expected) behaviour when I try to persist an "assigned" object that is already present in the database in that, I get StaleStateException instead of DataIntegrityViolationException
--
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: (HV-582) Introduce a class loading service
by Hardy Ferentschik (JIRA)
Introduce a class loading service
---------------------------------
Key: HV-582
URL: https://hibernate.onjira.com/browse/HV-582
Project: Hibernate Validator
Issue Type: New Feature
Components: engine
Affects Versions: 4.3.0.CR1
Reporter: Hardy Ferentschik
Fix For: 5.x
Currently all class loading in HV happens vi the _LoadClass_ _PrivilegedAction_. In the implementation we first check the thread context class loader and then the current class loader (unless we are loading own package classes in which case we use the current class loader). Historically that was a good approach, but in order to allow for customization in all sorts of environments it makes sense to have a way to configure the class loading approach. This could be done via a _ClassLoaderService_ which can for example be set via the _Configuration_.
Depending on which way Bean Validation goes this could be a HV specific feature or something defined by the spec.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 10 months