List of usage examples for org.hibernate.usertype UserType replace
Object replace(Object original, Object target, Object owner) throws HibernateException;
From source file:org.codekaizen.vtj.hibernate3.AbstractValueTypeUserTypeTest.java
License:Open Source License
@Test public void givenVTObjectWhenReplaceThenReturnSameObject() { UserType ut = this.newUserTypeInstance(); ValueType<?> vt1 = this.getDefaultTestInstance(); TestEntity entity = this.newTestEntity(); TestEntity entity2 = this.newTestEntity(); ValueType<?> vt2 = (ValueType<?>) ut.replace(vt1, entity, entity2); assertEquals(vt2, vt1);//from ww w .j av a 2 s .c om assertTrue(vt1 == vt2); }
From source file:org.codekaizen.vtj.hibernate3.AbstractValueTypeUserTypeTest.java
License:Open Source License
@Test public void givenNullWhenReplaceThenReturnNull() { UserType ut = this.newUserTypeInstance(); TestEntity entity = this.newTestEntity(); TestEntity entity2 = this.newTestEntity(); assertNull(ut.replace(null, entity, entity2)); }