[Hibernate-JIRA] Created: (ANN-834) Misplaced try-catch in org.hibernate.cfg.AnnotationConfiguration
by Ed Gow (JIRA)
Misplaced try-catch in org.hibernate.cfg.AnnotationConfiguration
----------------------------------------------------------------
Key: ANN-834
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-834
Project: Hibernate Annotations
Issue Type: Bug
Components: binder
Affects Versions: 3.4.0.GA
Reporter: Ed Gow
/**
* Read a mapping from the class annotation metadata (JSR 175).
*
* @param persistentClass the mapped class
* @return the configuration object
*/
The code is reproduced below.
A MappingException can be thrown from the toXClass() call, but never from the annotatedClasses.add() call as that is only a simple ArrayList. I believe that I'm experiencing a problem of lost exceptions due to this bug. I don't have a test case to reproduce it, but the bug is obvious from static analysis of the code even w/o a test case.
>From org.hibernate.cfg.AnnotationConfiguration:
public AnnotationConfiguration addAnnotatedClass(Class persistentClass) throws MappingException {
XClass persistentXClass = reflectionManager.toXClass( persistentClass );
try {
annotatedClasses.add( persistentXClass );
return this;
}
catch (MappingException me) {
log.error( "Could not compile the mapping annotations", me );
throw me;
}
}
--
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
15 years, 1 month
[Hibernate-JIRA] Created: (HHH-2355) CGLIBLazyInitializer can not access a public member if parent class is not public
by Daniel Beland (JIRA)
CGLIBLazyInitializer can not access a public member if parent class is not public
---------------------------------------------------------------------------------
Key: HHH-2355
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2355
Project: Hibernate3
Type: Bug
Versions: 3.2.1
Reporter: Daniel Beland
In hibernate 3.2.1, CGLIBLazyInitializer cannot acces a public method if it has been inherited from a parent class that is not public.
Let's say we have a class A, modifier = default (package) with a public method getName() (and setName(String name)).
Then I create a public class B that extends A.
in my code I can retrieve B from the database:
B b = session.load(B.class, new Integer(1), LockMode.NONE);
I receive b with all the values set correctly (So at this point, Hibernate was able to use the method setName() correctly).
In my code if I then try to use b.getName(), I receive and error:
java.lang.IllegalAccessException-->Class org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer can not access a member of class A with modifiers "public"
But I am not trying to access A.getName(), but B.getName() (which is a public method in a public class).
This was working perfectly with Hibernate 2.1.7c and 3.1.3.
The full information about my problem can be found here: http://forum.hibernate.org/viewtopic.php?t=969453
--
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
15 years, 1 month
[Hibernate-JIRA] Created: (HSEARCH-368) paging bug when search by interface
by DingWeilong (JIRA)
paging bug when search by interface
------------------------------------
Key: HSEARCH-368
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-368
Project: Hibernate Search
Issue Type: Bug
Components: query
Environment: 3.2.5ga and other versons, mysql 5, windows xp
Reporter: DingWeilong
Priority: Critical
this is the test case:
public interface Resource
{
....
}
this interface have 4 realized classes: Service,Solution, Product, System
I build my HQL script and search as follwows:
String hql="from Resource where ... "
Query query = session.createQuery(hql);
query.setFirstResult(firstResult);
query.setMaxResults(maxSize);
But the search result size is ALWAYS ZERO!
I did know number of the data in my database is not zero, and could be count and get by other client tools like MYSQL Administrator.
I reviewed my code and debug, and found if I commented the two line of paging(setFirstResult and setMaxResults), it works right.
I track in the source code and find the paging bug when query by superclass/interface:
take 3.2.5GA from example,
the method performList (line 146~203)of class org.hibernate.engine.query.HQLQueryPlan,
is the reason for my problem:
the line 184
if ( distinction.add( result ) ) {
continue;
}
you see,
the method add will return true if distinction don't have the result object, but if do as the former code, no result will be processed but at once do the next loop.
So, none of the results will be returned.
the line 184 SHOULD be
if (! distinction.add( result ) ) {
and this should be right for that case
Glad to see all your ideas about it. Thanks!
--
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
15 years, 1 month