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 booleanbooleanorg.modelmapper.ModelMapperfromMe()get_id()A few special measures have been taken in the interest of making this column queryable.Class<?>javax.money.CurrencyUnitTransient property that holds the parent price list currency in order to convert price to a MonetaryAmount.getName()javax.money.MonetaryAmountgetPrice()javax.money.MonetaryAmountgetTiers()com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTrackingjavax.money.MonetaryAmountinthashCode()voidpreFromMe(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, Object businessDomain) voidvoidsetActiveEndDate(Instant activeEndDate) voidsetActiveStartDate(Instant activeStartDate) voidsetAttributes(String attributes) A few special measures have been taken in the interest of making this column queryable.voidsetAvailableQuantity(Integer availableQuantity) voidsetCharacteristics(Map<String, String> characteristics) voidsetComplexAttributes(Map<String, Object> attributes) voidsetContextId(String contextId) voidsetCurrency(javax.money.CurrencyUnit currency) Transient property that holds the parent price list currency in order to convert price to a MonetaryAmount.voidsetDescription(String description) voidvoidsetPrice(javax.money.MonetaryAmount price) voidsetPriceListId(String priceListId) voidsetPriceListName(String priceListName) voidsetPriority(Integer priority) voidsetRecurringPeriodFrequency(Integer recurringPeriodFrequency) voidsetRecurringPeriodLimit(Integer recurringPeriodLimit) voidsetRecurringPeriodType(String recurringPeriodType) voidsetRecurringPrice(javax.money.MonetaryAmount recurringPrice) voidsetStartingQuantity(Integer startingQuantity) voidsetTargetContextId(String targetContextId) voidsetTargetType(String targetType) voidsetTargetVendorRef(String targetVendorRef) voidsetTermDurationLength(Integer termDurationLength) voidsetTermDurationType(String termDurationType) voidsetTiers(List<JpaPriceDataTier> tiers) voidsetTracking(com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTracking tracking) voidsetUsageAmount(BigDecimal usageAmount) voidsetUsagePrice(javax.money.MonetaryAmount usagePrice) voidsetUsageUnits(String usageUnits) org.modelmapper.ModelMappertoMe()toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
postFromMe, postToMe, preToMeMethods inherited from interface com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware
findNotificationStateMethods inherited from interface com.broadleafcommerce.data.tracking.core.Trackable
getNotificationStates, getNotificationStates, setNotificationStatesMethods 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:
preFromMein interfacecom.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
-
fromMe
@NonNull public org.modelmapper.ModelMapper fromMe()- Specified by:
fromMein interfacecom.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
-
toMe
@NonNull public org.modelmapper.ModelMapper toMe()- Specified by:
toMein interfacecom.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
-
getBusinessDomainType
- Specified by:
getBusinessDomainTypein interfacecom.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware
-
getDisplay
- Specified by:
getDisplayin 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:
getContextIdin 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:
getActiveStartDatein interfacecom.broadleafcommerce.data.tracking.core.filtering.ActiveAware- See Also:
-
getActiveEndDate
- Specified by:
getActiveEndDatein 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
MapwithStringkeys andObjectvalues 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 usingConvertwith anAttributeConverterto hook into automatic conversion mechanisms, we keep the field as aStringand explicitly implement getters and setters and mapping logic to convert between theMapstructure and theStringrepresentation. -
getTracking
public com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTracking getTracking()- Specified by:
getTrackingin interfacecom.broadleafcommerce.data.tracking.core.Trackable- See Also:
-
ApplicationJpaTracking
-
set_id
-
setContextId
- Specified by:
setContextIdin 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
MapwithStringkeys andObjectvalues 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 usingConvertwith anAttributeConverterto hook into automatic conversion mechanisms, we keep the field as aStringand explicitly implement getters and setters and mapping logic to convert between theMapstructure and theStringrepresentation. -
setTracking
public void setTracking(com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTracking tracking) - Specified by:
setTrackingin interfacecom.broadleafcommerce.data.tracking.core.TypedTrackable<com.broadleafcommerce.data.tracking.jpa.filtering.domain.ApplicationJpaTracking>- See Also:
-
ApplicationJpaTracking
-
toString
-
equals
-
canEqual
-
hashCode
public int hashCode()
-