The following comment has been added to this issue:
Author: Benoit Menendez
Created: Fri, 14 Nov 2003 11:20 PM
Body:
My bad... I guess this was OK with 2.0
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-472
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HB-472
Summary: Possible bug in AbstractEntityPersister
Type: Bug
Status: Closed
Priority: Major
Resolution: REJECTED
Project: Hibernate2
Components:
core
Versions:
2.1 rc1
Assignee:
Reporter: Benoit Menendez
Created: Fri, 14 Nov 2003 10:42 PM
Updated: Fri, 14 Nov 2003 10:57 PM
Description:
I know I shouldn't do this, but I am calling:
ClassPersister persister = getPersister(object);
Serializable identifier = persister.getIdentifier(object);
if (persister.isUnsaved(identifier)) ...
where object is declared to have an "assigned" id generator.
in AbstractEntityPersister.isUnsaved(Object object) the following lines:
...
if ( hasIdentifierPropertyOrEmbeddedCompositeIdentifier() ) {
return unsavedIdentifierValue.isUnsaved( getIdentifier(object) );
}
...
appear wrong since the unsavedIdentifierValue.isUnsaved needs to be passed the object, not the identifier...
Basically the getter method is called on the identifier (a String in this case) and not on the object itself.
com.proinsight.core.KMSException: net.sf.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of system.UserSession.id
at net.sf.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:110)
at net.sf.hibernate.persister.AbstractEntityPersister.getIdentifier(AbstractEntityPersister.java:284)
at net.sf.hibernate.persister.AbstractEntityPersister.isUnsaved(AbstractEntityPersister.java:406)
...
Caused by: java.lang.IllegalArgumentException: object is not an instance of declaring class
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:324)
at net.sf.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:96)
...
---------------------------------------------------------------------
JIRA INFORMATION:
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
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|