org.jasypt.hibernate4.type

## Class AbstractEncryptedAsStringType

- Object
- - org.jasypt.hibernate4.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 `UserType`s to store values as encrypted strings.
  Since:
    1.9.0
  Author:
    Daniel Fernández, Iván García Sáinz-Aja

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected org.jasypt.encryption.pbe.PBEStringEncryptor` | `encryptor`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractEncryptedAsStringType()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `assemble(Serializable cached, Object owner)`
    `protected void` | `checkInitialization()`
    `protected abstract Object` | `convertToObject(String string)` Converts given String to its Object form.
    `protected String` | `convertToString(Object object)` Converts given Object to its String form.
    `Object` | `deepCopy(Object value)`
    `Serializable` | `disassemble(Object value)`
    `boolean` | `equals(Object x, Object y)`
    `int` | `hashCode(Object x)`
    `boolean` | `isMutable()`
    `Object` | `nullSafeGet(ResultSet rs, String[] names, org.hibernate.engine.spi.SessionImplementor session, Object owner)`
    `void` | `nullSafeSet(PreparedStatement st, Object value, int index, org.hibernate.engine.spi.SessionImplementor session)`
    `Object` | `replace(Object original, Object target, Object owner)`
    `abstract Class` | `returnedClass()`
    `void` | `setParameterValues(Properties parameters)`
    `int[]` | `sqlTypes()`

    - ### Methods inherited from class Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### encryptor

          protected org.jasypt.encryption.pbe.PBEStringEncryptor encryptor

  - ### Constructor Detail

    - #### AbstractEncryptedAsStringType

          public AbstractEncryptedAsStringType()

  - ### Method Detail

    - #### 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

          protected 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()

      Specified by:
        `sqlTypes` in interface `org.hibernate.usertype.UserType`

    - #### 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.SessionImplementor session,
                                    Object owner)
                             throws org.hibernate.HibernateException,
                                    SQLException

      Specified by:
        `nullSafeGet` in interface `org.hibernate.usertype.UserType`
      Throws:
        `org.hibernate.HibernateException`
        `SQLException`

    - #### nullSafeSet

          public void nullSafeSet(PreparedStatement st,
                                  Object value,
                                  int index,
                                  org.hibernate.engine.spi.SessionImplementor 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()

Copyright © 2019 The JASYPT team. All rights reserved.