-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 posts ] 
Author Message
 Post subject: one-to-one mapping giving PropertyAccessException
PostPosted: Fri Jun 16, 2006 7:57 am 
Beginner
Beginner

Joined: Fri Jun 16, 2006 7:47 am
Posts: 27
I have a requirement to map a Table (ProdComp) with composite key,SPSOriginPK with another Table (ItemShipWindow) also having a different composite ke, SPSOriginPK_ItemShipWindow.

The relationship between the 2 tables is one-to-one mapping.

Say, the table names are ProdComp and ShipWindow. There is a one-to-one mapping from ProdComp to ShipWindow for the shipWindow property.

<one-to-one name="itemShipWindow" class="ShipWindow" constrained="true"/>

How do I map a foreign of ShipWindow to the PK of ProdComp?

However, it is giving an error:
org.hibernate.PropertyAccessException: exception getting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) getter of de.gloegl.road2hibernate.SPSOriginPK_ItemShipWindow.?


Top
 Profile  
 
 Post subject: Needed help urgently
PostPosted: Mon Jun 19, 2006 4:57 am 
Beginner
Beginner

Joined: Fri Jun 16, 2006 7:47 am
Posts: 27
Can any of you experts help me in this?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 19, 2006 5:17 am 
Regular
Regular

Joined: Tue May 16, 2006 3:32 am
Posts: 117
Have a look at 'property-ref' and see if it helps in your case:

http://www.hibernate.org/hib_docs/v3/re ... n-onetoone


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 20, 2006 2:12 am 
Beginner
Beginner

Joined: Fri Jun 16, 2006 7:47 am
Posts: 27
Hi Jayesh,

Thanks for your reply.

property-ref didn't help. The reason for this may be :

I have got a class A: with 5 PK (Composite id).
I have got a class B: with 4 PK ( Also, a composite id, having the first 4 PK of A).

Now, I need a one-to-one mapping from A->B.
If it were from B->A, then <property-ref> may have helped.

But here, it's not working.

Any help would be appreciated!

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 20, 2006 4:31 am 
Regular
Regular

Joined: Mon May 08, 2006 6:00 am
Posts: 53
Location: India
Get the latest CGLIB.jar, I think its latest version availbale is cglib-2.1.3.jar

Sudhir


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 20, 2006 4:33 am 
Regular
Regular

Joined: Mon May 08, 2006 6:00 am
Posts: 53
Location: India
also, please check whether the data type you are trying to retrive, does it contain null value, if it is of type "can contain NUll", then use a wrapper data type in POJO for that variable


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 21, 2006 1:50 am 
Beginner
Beginner

Joined: Fri Jun 16, 2006 7:47 am
Posts: 27
I don't think I can use the jar version that you recommend.
However, for the scenario that I mentioned :

[quote]I have got a class A: with 5 PK (Composite id).
I have got a class B: with 4 PK ( Also, a composite id, having the first 4 PK of A).

Now, I need a one-to-one mapping from A->B.
If it were from B->A, then <property-ref> may have helped.

But here, it's not working.
[/quote]

the version change of the jar may not be the solution.

Please help!

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 21, 2006 7:31 am 
Regular
Regular

Joined: Tue May 16, 2006 3:32 am
Posts: 117
This is what I understood:
A's PK = column1, column2, column3, column4, column5
B's PK = column1, column2, column3, column4.
You want a one-to-one relationship in A with B based on column1, column2, column3, column4.

Try this:

Code:
    <one-to-one name="b" constrained="true" cascade="all">
        <formula>column1</formula>
        <formula>column2</formula>
        <formula>column3</formula>
        <formula>column4</formula>
    </one-to-one>


Last edited by JayeshJ on Thu Jun 22, 2006 4:15 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 21, 2006 2:54 pm 
Beginner
Beginner

Joined: Fri Jun 16, 2006 7:47 am
Posts: 27
I have 2 table's ProdComp and ShipWindow. There is a one-to-one mapping from ProdComp to ShipWindow for the shipWindow property.

ProdComp has 5 PK's (Composite id), the first 4 of these are the PK's for ShipWindow (Composite id).

My problem is to have a one-to-one relationship from ProdComp to ShipWindow for the shipWindow property.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.