Example usage for org.hibernate.usertype UserType equals

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

Introduction

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

Prototype

boolean equals(Object x, Object y) throws HibernateException;

Source Link

Document

Compare two instances of the class mapped by this type for persistence "equality".

Usage

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

License:Open Source License

@Test
public void givenEquivalentVTObjectsWhenEqualsThenReturnTrue() {
    UserType ut = this.newUserTypeInstance();
    ValueType<?> vt1 = this.getDefaultTestInstance();
    ValueType<?> vt2 = this.getDefaultTestInstance();
    assertTrue(ut.equals(vt1, vt2));
}

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

License:Open Source License

@Test
public void givenOneOrMoreNullWhenEqualsThenReturnFalse() {
    UserType ut = this.newUserTypeInstance();
    ValueType<?> vt1 = this.getDefaultTestInstance();
    ValueType<?> vt2 = this.getDefaultTestInstance();
    assertFalse(ut.equals(null, vt2));
    assertFalse(ut.equals(vt1, null));//from ww w  .ja  va 2s.c om
    assertFalse(ut.equals(null, null));
}