Hi everyone!
I'm new to this group and I'd be very grateful if anyone could
help me or give me any tips. Here is my problem:
I'm developing a FDS application with database connection and
I've mapped the relational database to POJO's with Hibernate (using
hibernate tools). In the relational database, I have a table which
maps a N:M relationship between two entities and this table has a
composite primary key as the following example shows:
MODEL MODEL_PACK PACK
id id_model id
engine id_pack name
cab inclusion category
bed
...
id_model and id_pack is the composite primary key of MODEL_PACK
table. Hibernate tools generates a specific class which contains the
composite primary key. When I try to access to a row from PACK table
through an object which maps MODEL table using MODEL_PACK I get the
following exception:
[RPC Fault faultString="Unable to invoke a get operation on
destination 'ModelsPacks.hibernate' due to the following error: class
org.hibernate.PropertyAccessException:exception getting property
value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false
for more info) getter of com.fds.proyecto.hibernate.ModelPackId.?."
faultCode="Server.Processing" faultDetail="null"]
at
mx.data::ConcreteDataService/http://www.adobe.com/2006/flex/mx/interna
l::dispatchFaultEvent()
[C:\dev\enterprise_bali\frameworks\mx\data\ConcreteDataService.as:1602
]
at ConcreteDataService.as$76::DataListRequestResponder/fault()
[C:\dev\enterprise_bali\frameworks\mx\data\ConcreteDataService.as:4453
]
at mx.rpc::AsyncRequest/fault()
[C:\dev\enterprise_bali\frameworks\mx\rpc\AsyncRequest.as:107]
at
NetConnectionChannel.as$40::NetConnectionMessageResponder/NetConnectio
nChannel.as$40:NetConnectionMessageResponder::statusHandler()
[C:\dev\enterprise_bali\frameworks\mx\messaging\channels\NetConnection
Channel.as:470]
at mx.messaging::MessageResponder/status()
[C:\dev\enterprise_bali\frameworks\mx\messaging\MessageResponder.as:22
5]
I have the following classes in Action Script:
Model ModelPack Pack
id:int; id:ModelPackId; id:String
engine:string; model:Models; category:String;
... pack:Packs; ...
packs:ArrayCollection; inclusion:String; models:ArrayCollection
Which correspond to the appropriate classes in java. ModelPackId
is a class that represents the composite primary key of the
MODEL_PACK table:
modelCode:int;
packCode:String;
public function toString():String
{
return modelCode + ":" + packCode;
}
Having an object of type model:
m:Model;
I get the error when I try:
m.packs.getItemAt(1).pack
In the data-management-config.xml I have three destinations;
models.hibernate, ModelsPacks.hibernate and packs.hibernate:
<destination id="models.hibernate">
...........
<one-to-many property="packs"
destination="ModelsPacks.hibernate" lazy="true"/>
...........
<destination id="ModelsPacks.hibernate">
............
<identity property="id"
type="com.fds.proyecto.hibernate.ModelPackId"/>
<many-to-one property="model"
destination="models.hibernate" lazy="true"/>
<many-to-one property="pack"
destination="packs.hibernate" lazy="true"/>
.............
<destination id="packs.hibernate">
.............
<one-to-many property="models"
destination="ModelsPacks.hibernate" lazy="true"/>
..............
I've tried a lot of solutions but they didn't work. I hope that
anyone can help me.
Thanks in advance,
Carlos