Class AbstractEncryptedAsStringType

Object
org.jasypt.hibernate6.type.AbstractEncryptedAsStringType
All Implemented Interfaces:
org.hibernate.usertype.ParameterizedType, org.hibernate.usertype.UserType
Direct Known Subclasses:
EncryptedBigDecimalAsStringType, EncryptedBigIntegerAsStringType, EncryptedBooleanAsStringType, EncryptedByteAsStringType, EncryptedCalendarAsStringType, EncryptedDateAsStringType, EncryptedDoubleAsStringType, EncryptedFloatAsStringType, EncryptedIntegerAsStringType, EncryptedLongAsStringType, EncryptedShortAsStringType, EncryptedStringType

public abstract class AbstractEncryptedAsStringType extends Object implements org.hibernate.usertype.UserType, org.hibernate.usertype.ParameterizedType
Base class for Hibernate UserTypes to store values as encrypted strings.
Since:
1.9.0
Author:
Chus Picos
  • Field Details

    • encryptor

      protected org.jasypt.encryption.pbe.PBEStringEncryptor encryptor
  • Constructor Details

    • AbstractEncryptedAsStringType

      public AbstractEncryptedAsStringType()
  • Method Details

    • convertToObject

      protected abstract Object convertToObject(String string)
      Converts given String to its Object form.
      Parameters:
      string - the string value
      Returns:
      the object form of the passed String
    • convertToString

      public String convertToString(Object object)
      Converts given Object to its String form.
      Parameters:
      object - the object value
      Returns:
      the string form of the passes Object
    • sqlTypes

      public final int[] sqlTypes()
    • returnedClass

      public abstract Class<?> returnedClass()
      Specified by:
      returnedClass in interface org.hibernate.usertype.UserType
    • equals

      public final boolean equals(Object x, Object y) throws org.hibernate.HibernateException
      Specified by:
      equals in interface org.hibernate.usertype.UserType
      Throws:
      org.hibernate.HibernateException
    • deepCopy

      public final Object deepCopy(Object value) throws org.hibernate.HibernateException
      Specified by:
      deepCopy in interface org.hibernate.usertype.UserType
      Throws:
      org.hibernate.HibernateException
    • assemble

      public final Object assemble(Serializable cached, Object owner) throws org.hibernate.HibernateException
      Specified by:
      assemble in interface org.hibernate.usertype.UserType
      Throws:
      org.hibernate.HibernateException
    • disassemble

      public final Serializable disassemble(Object value) throws org.hibernate.HibernateException
      Specified by:
      disassemble in interface org.hibernate.usertype.UserType
      Throws:
      org.hibernate.HibernateException
    • isMutable

      public final boolean isMutable()
      Specified by:
      isMutable in interface org.hibernate.usertype.UserType
    • hashCode

      public final int hashCode(Object x) throws org.hibernate.HibernateException
      Specified by:
      hashCode in interface org.hibernate.usertype.UserType
      Throws:
      org.hibernate.HibernateException
    • replace

      public final Object replace(Object original, Object target, Object owner) throws org.hibernate.HibernateException
      Specified by:
      replace in interface org.hibernate.usertype.UserType
      Throws:
      org.hibernate.HibernateException
    • nullSafeGet

      public Object nullSafeGet(ResultSet rs, String[] names, org.hibernate.engine.spi.SharedSessionContractImplementor session, Object owner) throws org.hibernate.HibernateException, SQLException
      Throws:
      org.hibernate.HibernateException
      SQLException
    • nullSafeSet

      public void nullSafeSet(PreparedStatement st, Object value, int index, org.hibernate.engine.spi.SharedSessionContractImplementor session) throws org.hibernate.HibernateException, SQLException
      Specified by:
      nullSafeSet in interface org.hibernate.usertype.UserType
      Throws:
      org.hibernate.HibernateException
      SQLException
    • setParameterValues

      public void setParameterValues(Properties parameters)
      Specified by:
      setParameterValues in interface org.hibernate.usertype.ParameterizedType
    • checkInitialization

      protected final void checkInitialization()