Package de.xima.fc.persistence.hibernate
Class FcEncryptedBinaryType
- java.lang.Object
-
- de.xima.fc.persistence.hibernate.FcEncryptedBinaryType
-
- All Implemented Interfaces:
FcEncryptedUserType,org.hibernate.usertype.ParameterizedType,org.hibernate.usertype.UserType
- Direct Known Subclasses:
FCEncryptedBinaryType
public class FcEncryptedBinaryType extends Object implements FcEncryptedUserType, org.hibernate.usertype.UserType, org.hibernate.usertype.ParameterizedType
Hibernate UserType that maps a byte array field to an encrypted LOB field in the database.Parameters:
- defaultValue: The default value to use if decryption fails or the database value is null/empty.
- scope: Optional scope for the encryptor, can be used to differentiate between different encryption contexts.
- Since:
- 8.5.0
- Author:
- Norman Lorenz
-
-
Field Summary
Fields Modifier and Type Field Description static StringNAME-
Fields inherited from interface de.xima.fc.persistence.hibernate.FcEncryptedUserType
SCOPE
-
-
Constructor Summary
Constructors Constructor Description FcEncryptedBinaryType()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectassemble(Serializable cached, Object owner)ObjectdeepCopy(Object value)Serializabledisassemble(Object value)booleanequals(Object x, Object y)PropertiesgetConfig()Returns the encryption configuration for this type.inthashCode(Object x)booleanisMutable()ObjectnullSafeGet(ResultSet rs, String[] names, org.hibernate.engine.spi.SharedSessionContractImplementor session, Object owner)voidnullSafeSet(PreparedStatement st, Object value, int index, org.hibernate.engine.spi.SharedSessionContractImplementor session)Objectreplace(Object original, Object target, Object owner)ClassreturnedClass()voidsetParameterValues(Properties parameters)int[]sqlTypes()
-
-
-
Field Detail
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
assemble
public Object assemble(Serializable cached, Object owner) throws org.hibernate.HibernateException
- Specified by:
assemblein interfaceorg.hibernate.usertype.UserType- Throws:
org.hibernate.HibernateException
-
deepCopy
public Object deepCopy(Object value) throws org.hibernate.HibernateException
- Specified by:
deepCopyin interfaceorg.hibernate.usertype.UserType- Throws:
org.hibernate.HibernateException
-
disassemble
public Serializable disassemble(Object value) throws org.hibernate.HibernateException
- Specified by:
disassemblein interfaceorg.hibernate.usertype.UserType- Throws:
org.hibernate.HibernateException
-
equals
public boolean equals(Object x, Object y) throws org.hibernate.HibernateException
- Specified by:
equalsin interfaceorg.hibernate.usertype.UserType- Throws:
org.hibernate.HibernateException
-
hashCode
public int hashCode(Object x) throws org.hibernate.HibernateException
- Specified by:
hashCodein interfaceorg.hibernate.usertype.UserType- Throws:
org.hibernate.HibernateException
-
isMutable
public boolean isMutable()
- Specified by:
isMutablein interfaceorg.hibernate.usertype.UserType
-
nullSafeGet
public Object nullSafeGet(ResultSet rs, String[] names, org.hibernate.engine.spi.SharedSessionContractImplementor session, Object owner) throws org.hibernate.HibernateException, SQLException
- Specified by:
nullSafeGetin interfaceorg.hibernate.usertype.UserType- Throws:
org.hibernate.HibernateExceptionSQLException
-
nullSafeSet
public void nullSafeSet(PreparedStatement st, Object value, int index, org.hibernate.engine.spi.SharedSessionContractImplementor session) throws org.hibernate.HibernateException, SQLException
- Specified by:
nullSafeSetin interfaceorg.hibernate.usertype.UserType- Throws:
org.hibernate.HibernateExceptionSQLException
-
replace
public Object replace(Object original, Object target, Object owner) throws org.hibernate.HibernateException
- Specified by:
replacein interfaceorg.hibernate.usertype.UserType- Throws:
org.hibernate.HibernateException
-
returnedClass
public Class returnedClass()
- Specified by:
returnedClassin interfaceorg.hibernate.usertype.UserType
-
setParameterValues
public void setParameterValues(Properties parameters)
- Specified by:
setParameterValuesin interfaceorg.hibernate.usertype.ParameterizedType
-
sqlTypes
public int[] sqlTypes()
- Specified by:
sqlTypesin interfaceorg.hibernate.usertype.UserType
-
getConfig
public Properties getConfig()
Description copied from interface:FcEncryptedUserTypeReturns the encryption configuration for this type.- Specified by:
getConfigin interfaceFcEncryptedUserType- Returns:
- The configuration, may be null.
-
-