This looks like a pure hibernate question (at least I couldn't find
any JSF-specific information in it). You'll have far better luck
getting an answer on the hibernate mailing lists.
On 8/3/06, Rønnevik, Eivind <[EMAIL PROTECTED]> wrote:
Hi all :)
I have an abstract Folder class which contains:
Long folderId
String folderName
Folder parentFolder
And then I have different specifications of folders extending the abstract one.
The problem here is the "self-reference" of the parentFolder param, but I don't
see why this should be a problem. That said, it could be that this should be handled in a
specific way I'm not aware of.. ;)
My problem is that from time to time an exception is thrown, saying something
like:
javax.ejb.EJBTransactionRolledbackException:
org.hibernate.PropertyAccessException: exception setting property value with
CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter
of com.doc.folder.SpecificFolder.setParentFolder
The exception is always thrown at the setter of the specific class, not the
abstract one.
This is my mapping of the Folder class:
<hibernate-mapping package="com.doc.folder">
<class name="Folder" abstract="true">
<id name="folderId" column="folder_dbk" type="long">
<generator class="sequence">
<param name="sequence">kdoc_sequence</param>
</generator>
</id>
<property name="folderName" type="string" column="foldername" />
<many-to-one name="parentFolder" column="parentfolderid"
class="com.doc.folder.Folder" />
<union-subclass name="SpecificFolder" table="folder">
<property name="folderOpenIcon" type="string"
column="folderopenicon" />
<property name="folderClosedIcon" type="string"
column="folderclosedicon" />
</union-subclass>
</class>
</hibernate-mapping>
Anybody know why this happens? Or should the abstract/specific relations
together with self-referencing be handled in a specific way? :)
Thanks!
- Eivind -