Class PropertyJDBC
java.lang.Object
de.hybris.platform.persistence.property.PropertyJDBC
this class reads and writes new style (typed) properties via JDBC
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic EJBPropertyRowCachecreateProperties(TypeInfoMap infoMap, PK itemPK, PK typePK, PK langPK, long timestamp) static StringcutStringToByteLength(String str, int max) truncates a string to a certain byte length.getChangeData(Connection con, TypeInfoMap infoMap, EJBPropertyRowCache prc, boolean localized) for a modified property cache this puts together the list of columns, values and value classes.static EJBPropertyRowCachegetProperties(TypeInfoMap infoMap, PK itemPK, PK typePK, PK langPK, long timestamp) reads all unlocalized or localized properties of one language for a specified item in a property cache object.static voidpreloadLocalizedProperties(Set<PK> langPKs, Collection<LocalizableItemRemote> _items) static EJBPropertyRowCachereadPropertyRow(ResultSet rs, PK itemPK, PK itemTypePK, PK langPK, long timestamp, TypeInfoMap infoMap) static voidremoveAllPropertyData(PK itemPK, PK typePK) removes all property rows for a item.static voidupdatePropertyTypePKs(TypeInfoMap infoMap, PK itemPK, PK newTypePK) changes all property data rows of one item to the new type pk.static voidwriteProperties(EJBPropertyRowCache prc, PK itemPK, PK typePK, TypeInfoMap infoMap, boolean localized) saves all changed properties of one property cache.
-
Field Details
-
REAL_PK
- See Also:
-
REAL_TYPEPK
- See Also:
-
ITEMPK
- See Also:
-
LANGPK
- See Also:
-
ITEMTYPEPK
- See Also:
-
-
Constructor Details
-
PropertyJDBC
public PropertyJDBC()
-
-
Method Details
-
cutStringToByteLength
truncates a string to a certain byte length. is assumes that each non-ascii character takes 2 bytes space which is considered for how much has to be cut off.- Parameters:
max- the allowed max byte length
-
preloadLocalizedProperties
public static void preloadLocalizedProperties(Set<PK> langPKs, Collection<LocalizableItemRemote> _items) -
createProperties
public static EJBPropertyRowCache createProperties(TypeInfoMap infoMap, PK itemPK, PK typePK, PK langPK, long timestamp) -
getProperties
public static EJBPropertyRowCache getProperties(TypeInfoMap infoMap, PK itemPK, PK typePK, PK langPK, long timestamp) reads all unlocalized or localized properties of one language for a specified item in a property cache object.- Parameters:
itemPK- the PK of the item these properties belong totypePK- the item type - this is needed to get the correctTypeInfoMaplangPK- the language PK of the properties, ornullfor unlocalized propertiestimestamp- the property timestamp of the item - the propert cache uses this to check later if it is uptodate
-
updatePropertyTypePKs
changes all property data rows of one item to the new type pk. this will not invalidate any of its property caches - so make sure they are reloaded when the type has changed -
writeProperties
public static void writeProperties(EJBPropertyRowCache prc, PK itemPK, PK typePK, TypeInfoMap infoMap, boolean localized) saves all changed properties of one property cache.- Parameters:
prc- the (modified) property cacheinfoMap- provides the correct columns and value classes for these properties
-
getChangeData
public static List<Object>[] getChangeData(Connection con, TypeInfoMap infoMap, EJBPropertyRowCache prc, boolean localized) throws SQLException for a modified property cache this puts together the list of columns, values and value classes. use these to build and fill you SQL statements.- Parameters:
infoMap- provides column names and value classes for propertiesprc- the modified property cachelocalized- tells if localized or unlocalized properties should be written - used for checking correctness of datacon- the database connection- Returns:
- ([column - name, value, ValueWriter ])
- Throws:
SQLException
-
removeAllPropertyData
removes all property rows for a item.- Parameters:
itemPK- the item to remove properties fortypePK- used for getting the correctTypeInfoMap
-
readPropertyRow
public static EJBPropertyRowCache readPropertyRow(ResultSet rs, PK itemPK, PK itemTypePK, PK langPK, long timestamp, TypeInfoMap infoMap) throws SQLException - Throws:
SQLException
-