source: ether_ndacc/trunk/persistence/implementation/com/ether/SimpleUserType.java @ 105

Last change on this file since 105 was 105, checked in by rboipsl, 13 years ago

Import du projet NDACC _ module persistence

File size: 1013 bytes
Line 
1package com.ether;
2
3import org.hibernate.usertype.UserType;
4import org.hibernate.HibernateException;
5
6import java.io.Serializable;
7
8public abstract class SimpleUserType implements UserType
9{
10    public Object deepCopy(final Object value) throws HibernateException {
11        return value;
12    }
13
14    public boolean isMutable() {
15        return false;
16    }
17
18    public Object assemble(final Serializable cached, final Object owner)
19            throws HibernateException {
20        return cached;
21    }
22
23    public Serializable disassemble(final Object value)
24            throws HibernateException {
25        return (Serializable) value;
26    }
27
28    public Object replace(final Object original, final Object target,
29            final Object owner) throws HibernateException {
30        return original;
31    }
32
33    public int hashCode(final Object object) throws HibernateException {
34        return object.hashCode();
35    }
36
37    public boolean equals(final Object x, final Object y)
38            throws HibernateException {
39        return x == y || !(null == x || null == y) && x.equals(y);
40    }
41}
Note: See TracBrowser for help on using the repository browser.