I have Lead class with Set<Field> collection. In Field I have name, lead_id properties.
I have database1 and database2 and database1.field database2.field tables(the same columns and foreign keys). On database2.field I have
I need:
1. insert, update, load Field into database1, database2 as:
with name == name1 to database1
with name == name2 to database2
once field with name1, name2 inserts into databases its name never changes. simply other fields.
2. on the Lead class have field Set<Field> fields, and getFields(), setFields.
I have them already and don't want to change any api
3. I want to change some mapping, or writting some annotations, or rewrite loading, updating, inserting process of Field ( not Lead because it has some other foreign keys).
Can you suggest the ways I can do it?
|