List of usage examples for org.hibernate EntityMode parse
public static EntityMode parse(String entityMode)
From source file:com.hazelcast.hibernate.serialization.Hibernate3CacheKeySerializer.java
License:Open Source License
@Override public CacheKey read(ObjectDataInput in) throws IOException { try {//from w w w . jav a 2 s.co m Object key = in.readObject(); Type type = in.readObject(); String entityOrRoleName = in.readUTF(); EntityMode entityMode = EntityMode.parse(in.readUTF()); int hashCode = in.readInt(); CacheKey cacheKey = (CacheKey) UNSAFE.allocateInstance(CacheKey.class); UNSAFE.putObjectVolatile(cacheKey, KEY_OFFSET, key); UNSAFE.putObjectVolatile(cacheKey, TYPE_OFFSET, type); UNSAFE.putObjectVolatile(cacheKey, ENTITY_OR_ROLE_NAME_OFFSET, entityOrRoleName); UNSAFE.putObjectVolatile(cacheKey, ENTITY_MODE_OFFSET, entityMode); UNSAFE.putIntVolatile(cacheKey, HASH_CODE_OFFSET, hashCode); return cacheKey; } catch (Exception e) { if (e instanceof IOException) { throw (IOException) e; } throw new IOException(e); } }