Example usage for org.hibernate.usertype UserType deepCopy

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

Introduction

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

Prototype

Object deepCopy(Object value) throws HibernateException;

Source Link

Document

Return a deep copy of the persistent state, stopping at entities and at collections.

Usage

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

License:Open Source License

@Test
public void givenVTObjectWhenDeepCopyThenReturnSameObject() {
    UserType ut = this.newUserTypeInstance();
    ValueType<?> vt1 = this.getDefaultTestInstance();
    ValueType<?> vt2 = (ValueType<?>) ut.deepCopy(vt1);
    assertEquals(vt2, vt1);//w  ww. ja v  a  2 s . c om
    assertTrue(vt1 == vt2);
}

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

License:Open Source License

@Test
public void givenNullWhenDeepCopyThenReturnNull() {
    UserType ut = this.newUserTypeInstance();
    assertNull(ut.deepCopy(null));
}