Example usage for org.hibernate.usertype UserType hashCode

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

Introduction

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

Prototype

int hashCode(Object x) throws HibernateException;

Source Link

Document

Get a hashcode for the instance, consistent with persistence "equality"

Usage

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

License:Open Source License

@Test
public void givenVTObjectWhenHashCodeThenReturnObjectHashCode() {
    UserType ut = this.newUserTypeInstance();
    ValueType<?> vt = this.getDefaultTestInstance();
    assertEquals(ut.hashCode(vt), vt.hashCode());
}

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

License:Open Source License

@Test
public void givenNullWhenHashCodeThenReturnZero() {
    UserType ut = this.newUserTypeInstance();
    assertEquals(ut.hashCode(null), 0);
}