public interface DerivedMappable
| 修飾子とタイプ | フィールドと説明 |
|---|---|
static String |
MAPPING_ALIAS_PREFIX
The prefix mark for derived mapping alias.
|
| 修飾子とタイプ | メソッドと説明 |
|---|---|
<VALUE> OptionalScalar<VALUE> |
derived(String aliasName,
Class<VALUE> propertyType)
Find the derived value from derived map by alias name (starts with '$').
|
void |
registerDerivedValue(String aliasName,
Object selectedValue)
Register value derived by (Specify)DerivedReferrer.
|
void registerDerivedValue(String aliasName, Object selectedValue)
aliasName - The alias name of derived-referrer. (NotNull)selectedValue - The selected value from database. (NullAllowed)<VALUE> OptionalScalar<VALUE> derived(String aliasName, Class<VALUE> propertyType)
mapping type: count() : Integer max(), min() : (same as property type of the column) sum(), avg() : BigDecimal e.g. use count() member.derived("$LOGIN_COUNT", Integer.class).alwaysPresent(loginCount -> { log(loginCount.getClass()); // is Integer ... }); e.g. use max() member.derived("$LATEST_PURCHASE_DATETIME", LocalDateTime.class).ifPresent(latestPurchaseDatetime -> { log(latestPurchaseDatetime.getClass()); // is LocalDateTime ... }); e.g. overview String highestAlias = "$HIGHEST_PURCHASE_PRICE"; memberBhv.selectEntity(cb -> { cb.specify().derivedPurchase().max(purchaseCB -> { purchaseCB.specify().columnPurchasePrice(); purchaseCB.query()... }, highestAlias); cb.query().setMemberId_Equal(1); ... }).alwaysPresent(member -> { ... = member.getMemberName(); member.derived(highestAlias, Integer.class).ifPresent(highestPurchasePrice -> { log(highestPurchasePrice); ... }); });
VALUE - The type of the value.aliasName - The alias name of derived-referrer, should start with '$'. (NotNull)propertyType - The type of the derived property, should match as rule. (NotNull)SpecifyDerivedReferrerInvalidAliasNameException - When the alias name does not start with '$'.SpecifyDerivedReferrerUnknownAliasNameException - When the alias name is unknown, no derived.SpecifyDerivedReferrerUnmatchedPropertyTypeException - When the property type is unmatched with actual type.Copyright © 2014–2015 The DBFlute Project. All rights reserved.