|
|
Re: Dynamic JPA and AttributeOverrides [message #809821 is a reply to message #808359] |
Wed, 29 February 2012 09:50 |
Sunil Varma Messages: 5 Registered: February 2012 |
Junior Member |
|
|
Thanks for your response.I tried using the approach but it looks like the overridden mapping specified via "addFieldNameTranslation"is being ignored .
In the code below Iam expecting "EMD_ATTR2.JsonString" to use the db mapping "db_jsonstring_2" but it reverts to "db_jsonstring".
//////START CODE
configureEmbeddable(emdType);
....
dynType.addAggregateObjectMapping("EMD_ATTR", emdType.getType(), false);
AggregateObjectMapping mapping = dynType.addAggregateObjectMapping("EMD_ATTR2", emdType.getType(), false);
mapping.addFieldNameTranslation("db_jsonstring_2","JsonString") ; //overriding here
private static void configureEmbeddable(JPADynamicTypeBuilder emdType) {
emdType.addDirectMapping("Data_Type", String.class, "db_data_type");
emdType.addDirectMapping("JsonString", String.class, "db_jsonstring");
}
/////////END CODE
|
|
|
|
|
Re: Dynamic JPA and AttributeOverrides [message #813714 is a reply to message #810908] |
Mon, 05 March 2012 16:29 |
|
This does work in general, but I'm not sure how the Dynamic support initializes the descriptors.
Ensure you define the parent and child descriptors together.
There could be an issue with how Dynamic JPA does initialization, which you may wish to log a bug on.
Does it work if you use an orm.xml instead of the API?
James : Wiki : Book : Blog : Twitter
|
|
|
|
Powered by
FUDForum. Page generated in 0.03716 seconds