@Entity public class Product extends HierarchialDomainObjectWithAttributes<Product,ProductAttribute> implements IProductReference, Identifiable<Long>, org.apache.commons.collections.Transformer
Product
Inheritance.strategy()
as InheritanceType.SINGLE_TABLE
and a default DiscriminatorValue
defaultModifier and Type | Class and Description |
---|---|
static class |
Product.BIT_MASKS |
ATTRIB_HIERARCHY_STARTS_LIKE, ATTRIB_PRODUCT_PARENT, displayName, parentId
ROOT
Constructor and Description |
---|
Product() |
Product(Product p) |
Product(ProductReference ref) |
Product(String json) |
Modifier and Type | Method and Description |
---|---|
Product |
clone() |
Map<String,ProductAttribute> |
getAttributes()
Any attribute that is not common for most of the entities belongs to be an Attribute rather than a field.
|
Integer |
getBitmask() |
String |
getDescription() |
Long |
getId()
Id with GeneratedValue.strategy() of GenerationType.AUTO |
String |
getModelCode()
A code that identifies a product's model.
|
String |
getName()
Unique Name to refer to the record
Id is an Auto generated number used by the system,
but is difficult for the outside world to get a handle on it.
|
String |
getProductCode()
A code uniquely identifies a product and has a one to one mapping with SKU.
However this is optional and a more human readable way to recognize the product in the system. |
ProductReference |
getReference() |
String |
getRelatedGroups()
A JSON string of the format ["sku":[.,.,.],"modelCode":[...],"productCode":[.,.,.]]
This defines a collection/group related to this product. |
String |
getTags()
Comma separated list of tag Ids
|
String |
safeDisplayName()
Display Name (Can contain HTML)
If you want to display the name without HTML use MarshalUtils.regexReplace(safeDisplayName, HTMLUtils.html4Replacer) |
Product |
setAttribute(String name,
String value)
Any attribute that is not common for most of the entities belongs to be an Attribute rather than a field.
|
void |
setAttributes(Map<String,ProductAttribute> attributes)
Any attribute that is not common for most of the entities belongs to be an Attribute rather than a field.
|
void |
setBitmask(Integer bitmask) |
void |
setDescription(String description) |
void |
setId(Long id)
Id with GeneratedValue.strategy() of GenerationType.AUTO |
void |
setModelCode(String modelCode)
A code that identifies a product's model.
|
void |
setName(String name)
Unique Name to refer to the record
Id is an Auto generated number used by the system,
but is difficult for the outside world to get a handle on it.
|
void |
setProductCode(String productCode)
A code uniquely identifies a product and has a one to one mapping with SKU.
However this is optional and a more human readable way to recognize the product in the system. |
void |
setRelatedGroups(String relatedGroups)
A JSON string of the format ["sku":[.,.,.],"modelCode":[...],"productCode":[.,.,.]]
This defines a collection/group related to this product. |
void |
setTags(String tags)
Comma separated list of tag Ids
|
String |
transform(Object obj) |
getAttribute, getAttributeValue
equals, getDisplayName, getHierarchy, getParentId, hashCode, setDisplayName, setHierarchy, setParentId, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
getHierarchy, getParentId, setHierarchy, setParentId
getDisplayName
public Product()
public Product(String json)
public Product(Product p)
public Product(ProductReference ref)
public Long getId()
Id
with GeneratedValue.strategy()
of GenerationType.AUTO
getId
in interface IHierarchialReference<Long>
getId
in interface Identifiable<Long>
public void setId(Long id)
Id
with GeneratedValue.strategy()
of GenerationType.AUTO
setId
in interface IHierarchialReference<Long>
setId
in interface Identifiable<Long>
public String safeDisplayName()
MarshalUtils.regexReplace(safeDisplayName, HTMLUtils.html4Replacer)
public String getName()
getName
in interface IHierarchialReference<Long>
public void setName(String name)
setName
in interface IHierarchialReference<Long>
public String getDescription()
public void setDescription(String description)
public String getTags()
public void setTags(String tags)
String
- public Integer getBitmask()
Product.BIT_MASKS
public void setBitmask(Integer bitmask)
Product.BIT_MASKS
public Map<String,ProductAttribute> getAttributes()
getAttributes
in class HierarchialDomainObjectWithAttributes<Product,ProductAttribute>
public void setAttributes(Map<String,ProductAttribute> attributes)
setAttributes
in class HierarchialDomainObjectWithAttributes<Product,ProductAttribute>
public Product setAttribute(String name, String value)
setAttribute
in interface Attributes<Product,String>
setAttribute
in class HierarchialDomainObjectWithAttributes<Product,ProductAttribute>
name
- as Stringvalue
- as public String getProductCode()
getProductCode
in interface IProductReference
public void setProductCode(String productCode)
setProductCode
in interface IProductReference
public String getModelCode()
productCode
& #sku
.public void setModelCode(String modelCode)
productCode
& #sku
.public String getRelatedGroups()
public void setRelatedGroups(String relatedGroups)
public ProductReference getReference()
public Product clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
Copyright © 2018. All rights reserved.