Example usage for org.hibernate.usertype UserType assemble

List of usage examples for org.hibernate.usertype UserType assemble

Introduction

In this page you can find the example usage for org.hibernate.usertype UserType assemble.

Prototype

Object assemble(Serializable cached, Object owner) throws HibernateException;

Source Link

Document

Reconstruct an object from the cacheable representation.

Usage

From source file:org.codekaizen.vtj.hibernate3.AbstractValueTypeUserTypeTest.java

License:Open Source License

@Test
public void givenVTObjectWhenAssembleThenReturnSameObject() {
    UserType ut = this.newUserTypeInstance();
    ValueType<?> vt1 = this.getDefaultTestInstance();
    TestEntity entity = this.newTestEntity();
    ValueType<?> vt2 = (ValueType<?>) ut.assemble(vt1, entity);
    assertEquals(vt2, vt1);/*from www.j a  va 2  s  . c om*/
    assertTrue(vt1 == vt2);
}

From source file:org.codekaizen.vtj.hibernate3.AbstractValueTypeUserTypeTest.java

License:Open Source License

@Test
public void givenNullWhenAssembleThenReturnNull() {
    UserType ut = this.newUserTypeInstance();
    TestEntity entity = this.newTestEntity();
    assertNull(ut.assemble(null, entity));
}