Class JpaPriceData
- All Implemented Interfaces:
com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware
,com.broadleafcommerce.data.tracking.core.ApplicationTrackable<com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTracking>
,com.broadleafcommerce.data.tracking.core.filtering.ActiveAware
,com.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware
,com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
,com.broadleafcommerce.data.tracking.core.Trackable
,com.broadleafcommerce.data.tracking.core.TypedTrackable<com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTracking>
,Serializable
PriceData
for use with a JPA datastore.- Author:
- Chad Harchar (charchar), Nathan Moore (nathanmoore)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
org.modelmapper.ModelMapper
fromMe()
get_id()
A few special measures have been taken in the interest of making this column queryable.Class<?>
javax.money.CurrencyUnit
Transient property that holds the parent price list currency in order to convert price to a MonetaryAmount.getName()
javax.money.MonetaryAmount
getPrice()
javax.money.MonetaryAmount
getTiers()
com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTracking
javax.money.MonetaryAmount
int
hashCode()
void
preFromMe
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, Object businessDomain) void
void
setActiveEndDate
(Instant activeEndDate) void
setActiveStartDate
(Instant activeStartDate) void
setAttributes
(String attributes) A few special measures have been taken in the interest of making this column queryable.void
setAvailableQuantity
(Integer availableQuantity) void
setCharacteristics
(Map<String, String> characteristics) void
setComplexAttributes
(Map<String, Object> attributes) void
setContextId
(String contextId) void
setCurrency
(javax.money.CurrencyUnit currency) Transient property that holds the parent price list currency in order to convert price to a MonetaryAmount.void
setDescription
(String description) void
void
setPrice
(javax.money.MonetaryAmount price) void
setPriceListId
(String priceListId) void
setPriceListName
(String priceListName) void
setPriority
(Integer priority) void
setRecurringPeriodFrequency
(Integer recurringPeriodFrequency) void
setRecurringPeriodLimit
(Integer recurringPeriodLimit) void
setRecurringPeriodType
(String recurringPeriodType) void
setRecurringPrice
(javax.money.MonetaryAmount recurringPrice) void
setStartingQuantity
(Integer startingQuantity) void
setTargetContextId
(String targetContextId) void
setTargetType
(String targetType) void
setTargetVendorRef
(String targetVendorRef) void
setTermDurationLength
(Integer termDurationLength) void
setTermDurationType
(String termDurationType) void
setTiers
(List<JpaPriceDataTier> tiers) void
setTracking
(com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTracking tracking) void
setUsageAmount
(BigDecimal usageAmount) void
setUsagePrice
(javax.money.MonetaryAmount usagePrice) void
setUsageUnits
(String usageUnits) org.modelmapper.ModelMapper
toMe()
toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
postFromMe, postToMe, preToMe
Methods inherited from interface com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware
findNotificationState
Methods inherited from interface com.broadleafcommerce.data.tracking.core.Trackable
getNotificationStates, getNotificationStates, setNotificationStates
Methods inherited from interface com.broadleafcommerce.data.tracking.core.TypedTrackable
setTracking
-
Constructor Details
-
JpaPriceData
public JpaPriceData()
-
-
Method Details
-
preFromMe
public void preFromMe(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, Object businessDomain) - Specified by:
preFromMe
in interfacecom.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
-
fromMe
@NonNull public org.modelmapper.ModelMapper fromMe()- Specified by:
fromMe
in interfacecom.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
-
toMe
@NonNull public org.modelmapper.ModelMapper toMe()- Specified by:
toMe
in interfacecom.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
-
getBusinessDomainType
- Specified by:
getBusinessDomainType
in interfacecom.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware
-
getDisplay
- Specified by:
getDisplay
in interfacecom.broadleafcommerce.data.tracking.core.Trackable
-
getPrice
public javax.money.MonetaryAmount getPrice() -
setPrice
public void setPrice(javax.money.MonetaryAmount price) -
getRecurringPrice
public javax.money.MonetaryAmount getRecurringPrice() -
setRecurringPrice
public void setRecurringPrice(javax.money.MonetaryAmount recurringPrice) -
getUsagePrice
public javax.money.MonetaryAmount getUsagePrice() -
setUsagePrice
public void setUsagePrice(javax.money.MonetaryAmount usagePrice) -
setComplexAttributes
- Parameters:
attributes
- the complex object representation of attributes to convert and set- See Also:
-
attributes
-
getComplexAttributes
- Returns:
- the complex object representation of attributes
- See Also:
-
attributes
-
get_id
-
getContextId
- Specified by:
getContextId
in interfacecom.broadleafcommerce.data.tracking.core.Trackable
- See Also:
-
Trackable.getContextId()
-
getPriceListId
- See Also:
-
getPriceListName
- See Also:
-
getTargetContextId
-
getTargetType
- See Also:
-
PriceableTarget.getTargetType()
-
getTargetVendorRef
-
getCurrency
public javax.money.CurrencyUnit getCurrency()Transient property that holds the parent price list currency in order to convert price to a MonetaryAmount. -
getActiveStartDate
- Specified by:
getActiveStartDate
in interfacecom.broadleafcommerce.data.tracking.core.filtering.ActiveAware
- See Also:
-
getActiveEndDate
- Specified by:
getActiveEndDate
in interfacecom.broadleafcommerce.data.tracking.core.filtering.ActiveAware
- See Also:
-
getStartingQuantity
- See Also:
-
getAvailableQuantity
- See Also:
-
getTiers
- See Also:
-
getName
- See Also:
-
getDescription
- See Also:
-
getUsageAmount
- See Also:
-
getUsageUnits
- See Also:
-
getRecurringPeriodFrequency
- See Also:
-
getRecurringPeriodType
- See Also:
-
getRecurringPeriodLimit
- See Also:
-
getTermDurationLength
- See Also:
-
getTermDurationType
- See Also:
-
getCharacteristics
-
getPriority
- See Also:
-
getAttributes
A few special measures have been taken in the interest of making this column queryable.
Firstly, regarding column size: Oracle's VARCHAR maxes out at a conservative 4000 bytes. Thus, we set the length limit to 4000, which results in a changeset that looks like VARCHAR(4000 CHAR). When using a multi-byte character set (ex: AL32UTF8), the actual length limit may not be 4000 characters and may instead be 1000 characters if using 4 byte characters. However, in practice, multi-byte character sets are variable-width and therefore in most cases each character will continue to only use 1 byte. See this post for more details.
Regarding RSQL filtration support: This is really a
Map
withString
keys andObject
values and is serialized to a JSON string for persistence. In order to allow RSQL filters to target this field as aString
, we need to keep its Java type as such to pass Hibernate type consistency validations (Hibernate will otherwise require the filtration parameter to also be aMap
, for example). As a result, rather than usingConvert
with anAttributeConverter
to hook into automatic conversion mechanisms, we keep the field as aString
and explicitly implement getters and setters and mapping logic to convert between theMap
structure and theString
representation. -
getTracking
public com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTracking getTracking()- Specified by:
getTracking
in interfacecom.broadleafcommerce.data.tracking.core.Trackable
- See Also:
-
ApplicationJpaTracking
-
set_id
-
setContextId
- Specified by:
setContextId
in interfacecom.broadleafcommerce.data.tracking.core.Trackable
- See Also:
-
Trackable.getContextId()
-
setPriceListId
- See Also:
-
setPriceListName
- See Also:
-
setTargetContextId
-
setTargetType
- See Also:
-
PriceableTarget.getTargetType()
-
setTargetVendorRef
-
setCurrency
public void setCurrency(javax.money.CurrencyUnit currency) Transient property that holds the parent price list currency in order to convert price to a MonetaryAmount. -
setActiveStartDate
- See Also:
-
setActiveEndDate
- See Also:
-
setStartingQuantity
- See Also:
-
setAvailableQuantity
- See Also:
-
setTiers
- See Also:
-
setName
- See Also:
-
setDescription
- See Also:
-
setUsageAmount
- See Also:
-
setUsageUnits
- See Also:
-
setRecurringPeriodFrequency
- See Also:
-
setRecurringPeriodType
- See Also:
-
setRecurringPeriodLimit
- See Also:
-
setTermDurationLength
- See Also:
-
setTermDurationType
- See Also:
-
setCharacteristics
-
setPriority
- See Also:
-
setAttributes
A few special measures have been taken in the interest of making this column queryable.
Firstly, regarding column size: Oracle's VARCHAR maxes out at a conservative 4000 bytes. Thus, we set the length limit to 4000, which results in a changeset that looks like VARCHAR(4000 CHAR). When using a multi-byte character set (ex: AL32UTF8), the actual length limit may not be 4000 characters and may instead be 1000 characters if using 4 byte characters. However, in practice, multi-byte character sets are variable-width and therefore in most cases each character will continue to only use 1 byte. See this post for more details.
Regarding RSQL filtration support: This is really a
Map
withString
keys andObject
values and is serialized to a JSON string for persistence. In order to allow RSQL filters to target this field as aString
, we need to keep its Java type as such to pass Hibernate type consistency validations (Hibernate will otherwise require the filtration parameter to also be aMap
, for example). As a result, rather than usingConvert
with anAttributeConverter
to hook into automatic conversion mechanisms, we keep the field as aString
and explicitly implement getters and setters and mapping logic to convert between theMap
structure and theString
representation. -
setTracking
public void setTracking(com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTracking tracking) - Specified by:
setTracking
in interfacecom.broadleafcommerce.data.tracking.core.TypedTrackable<com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTracking>
- See Also:
-
ApplicationJpaTracking
-
toString
-
equals
-
canEqual
-
hashCode
public int hashCode()
-