The core application I am working on needs to support a bilingual webapplication in near future.
Few of the transaction table and all of the static table has localization data.
I am lost at representing this data at object model.Should the localization table be represented as a Map or List of localization objects in the main object ?
Below is the Data Model,
DEAL table
------------------------------------------------------------------------
DEAL_ID | DEAL_NAME | DEAL_OWNER | CREATED_DATE | CREATED_BY | DEAL_TYPE
1 test test 29-10-2105 user 1
2 test test 29-10-2105 user 2
3 test test 29-10-2105 user 2
4 test test 29-10-2105 user 1
DEAL_LOCALIZATION table
------------------------------------------------------------------------
DEAL_ID | LANGUAGE_CODE | DEAL_NAME | DEAL_DESC
1 en test1 test name
1 jp テスト1 test name
2 en test2 test name
2 jp テスト2 test name
DEAL_TYPE table
-------------------------------------------------------------------------
ID
1
2
DEAL_TYPE_LOCALIZATION table
-------------------------------------------------------------------------
ID | LANGUAGE_CODE | TYPE_NAME
1 en dealtype1
2 en dealtype2
1 jp ビジネスケース1
2 jp ビジネスケース2
Should the Deal object has a list of DealType,DealLocalization object or Deal object should have a map of Dealtype,DealLocalization objects with a LocalKey (id,LanguageCode) object as key.
Thanks in advance for suggestions.
In Hibernate,
@OneToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "DEAL_ID")
public Deal getDeal() {
return deal;
}
in the Deal_Localization class would probably be enough. Do you really need anything more?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With