Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] OneToOne AND ManyToOne Mapping works with FetchType.EAGER but not with FetchType.LAZY -> Exception when deploying (SGES 2.1)

Hi,

I have exactly the same problem in my application!

I use:
EclipseLink 1.0.2/1.1.0 (both fail)
Spring 2.5.6
Tomcat 6.0

The problem is here with the bi-directional @OneToOne(mappedBy="...")
mappings.
If I do not specify FetchType.LAZY then I get a StackOverflowError. I guess
this is because an EAGER fetch on both sides causes kind of recursion. So I
put a LAZY fetch on the entity that contains the mappedBy clause.
Now deployment to Tomcat is still working, but at runtime an exception is
thrown:

Exception [EclipseLink-60] (Eclipse Persistence Services -
1.1.0.r3639-SNAPSHOT):
org.eclipse.persistence.exceptions.DescriptorException
Exception Description: The method [_persistence_setrootFolder_vh] or
[_persistence_getrootFolder_vh] is not defined in the object
[com.example.domain.BackupDefinition].
Internal Exception: java.lang.NoSuchMethodException:
com.example.domain.BackupDefinition._persistence_getrootFolder_vh()
Mapping: org.eclipse.persistence.mappings.OneToOneMapping[rootFolder]
Descriptor: RelationalDescriptor(com.example.domain.BackupDefinition -->
[DatabaseTable(BACKUPDEFINITION)])

I debugged into EclipseLink (PrivilegedAccessHelper.findMethod(...)) and I
could see that this class BackupDefinition does not have any of these
_persistence_* methods. All other entity class do. Why is that?

Any idea how to fix this?
Stevy


-- 
View this message in context: http://www.nabble.com/OneToOne-Mapping-works-with-FetchType.EAGER-but-not-with-FetchType.LAZY--%3E-Exception-when-deploying-%28SGES-2.1%29-tp21711849p22969114.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top