Interface BasicValuedMapping

    • Method Detail

      • disassemble

        default Object disassemble​(Object value,
                                   SharedSessionContractImplementor session)
        Description copied from interface: Bindable
        Breaks down a value of J into its simple pieces. E.g., an embedded value gets broken down into an array of its attribute state; a basic value converts to itself; etc.

        Generally speaking, this is the form in which entity state is kept relative to a Session via EntityEntry.

         @Entity class Person {
             @Id Integer id;
             @Embedded Name name;
             int age;
         @Embeddable class Name {
             String familiarName;
             String familyName;

        At the top level, we would want to disassemble a Person value, so we'd ask the Bindable for the Person entity to disassemble. Given a Person value:

         Person( id=1, name=Name( 'Steve', 'Ebersole' ), 28 )

        this disassemble would result in a multidimensional array:

         [ ["Steve", "Ebersole"], 28 ]

        Note that the identifier is not part of this disassembled state. Note also how the embedded value results in a sub-array.

        Specified by:
        disassemble in interface Bindable
        See Also: