Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] AggregateCollectionMapping in dynamic Mapping

Hi, All
I am using the Dynamic Map feature in eclipselink.
I noticed that JPADynamicTypeBuilder does not have a method to add
AggregateCollectionMapping method. AggregateCollectionMapping should
be the one for ElementCollection in JPA for embedded class.

I has this piece code to handle AggregateCollectionMapping


        ------------------------------
AggregateCollectionMapping mapping=new AggregateCollectionMapping();
  mapping.setDefaultSourceTable(table);
  mapping.setAttributeName(name);
   mapping.setReferenceClass(embeddedBuilder.getType().getJavaClass());

        DatabaseField
fPk=builder.getType().getDescriptor().getPrimaryKeyFields().get(0);
        mapping.addTargetForeignKeyField( new DatabaseField("mainID"), fPk);

   builder.addMapping(mapping);
-----------------------

With this code, I can add a list of embedded objects. But, I can not
modify or delete them.

Any suggestion?

thanks
-jason
-jiesheng


Back to the top