# /--------------------------------------------------------------------------- # additionalForeignKeyMap: (NotRequired - Default 'map:{}') # # If foreign key does not exist in your database, # you can set up here as virtual foreign key for DBFlute. # # And it's one-to-one relation if you add one fixed condition to referrer table, # you can set virtual foreign key with fixedCondition and fixedSuffix. # And you can use it to view objects too. # # If local column name is same as foreign column name, # you can omit the setting of localColumnName and foreignColumnName. # The names are treated as case insensitive. # # Example: # map:{ # ; FK_MEMBER_MEMBER_STATUS_CODE = map:{ # ; localTableName = MEMBER ; foreignTableName = MEMBER_STATUS # ; localColumnName = MEMBER_STATUS_CODE ; foreignColumnName = MEMBER_STATUS_CODE # } # ; FK_PURCHASE_MEMBER_ID = map:{ # ; localTableName = PURCHASE ; foreignTableName = MEMBER # } # ; FK_MEMBER_MEMBER_ADDRESS_VALID = map:{ # ; localTableName = MEMBER ; foreignTableName = MEMBER_ADDRESS # ; localColumnName = MEMBER_ID ; foreignColumnName = MEMBER_ID # ; fixedCondition = # $$foreignAlias$$.VALID_BEGIN_DATE <= /*targetDate(Date)*/null # and $$foreignAlias$$.VALID_END_DATE >= /*targetDate(Date)*/null # ; fixedSuffix = AsValid # } # } # # *The line that starts with '#' means comment-out. # map:{ # ==================================================================================== # Member # ====== ; FK_MEMBER_MEMBER_ADDRESS_VALID = map:{ ; localTableName = MEMBER ; foreignTableName = MEMBER_ADDRESS ; localColumnName = MEMBER_ID ; foreignColumnName = MEMBER_ID ; fixedCondition = $$foreignAlias$$.VALID_BEGIN_DATE <= /*targetDate(Date)*/null and $$foreignAlias$$.VALID_END_DATE >= /*targetDate(Date)*/null ; fixedSuffix = AsValid ; comment = 「会員」から「指定された日付の会員住所」への業務的one-to-one } ; FK_MEMBER_MEMBER_LOGIN_LATEST = map:{ ; localTableName = MEMBER ; foreignTableName = MEMBER_LOGIN ; localColumnName = MEMBER_ID ; foreignColumnName = MEMBER_ID ; fixedCondition = $$foreignAlias$$.LOGIN_DATETIME = ($$sqbegin$$ select max(login.LOGIN_DATETIME) from MEMBER_LOGIN login where login.MEMBER_ID = $$foreignAlias$$.MEMBER_ID )$$sqend$$ ; fixedSuffix = AsLatest ; comment = 「会員」から「最終ログイン」への業務的one-to-one } # ==================================================================================== # View Object # =========== ; FK_SUMMARY_PRODUCT_PRODUCT_STATUS = map:{ ; localTableName = SUMMARY_PRODUCT ; foreignTableName = PRODUCT_STATUS ; localColumnName = PRODUCT_STATUS_CODE ; foreignColumnName = PRODUCT_STATUS_CODE } ; FK_PURCHASE_SUMMARY_PRODUCT = map:{ ; localTableName = PURCHASE ; foreignTableName = SUMMARY_PRODUCT ; localColumnName = PRODUCT_ID ; foreignColumnName = PRODUCT_ID } } # ----------------/