1 package org.hibernate.cache.entry; 3 4 import java.io.Serializable ; 5 import java.util.Arrays ; 6 import java.util.List ; 7 8 import org.hibernate.engine.SessionFactoryImplementor; 9 10 13 public class StructuredCollectionCacheEntry implements CacheEntryStructure { 14 15 public Object structure(Object item) { 16 CollectionCacheEntry entry = (CollectionCacheEntry) item; 17 return Arrays.asList( entry.getState() ); 18 } 19 20 public Object destructure(Object item, SessionFactoryImplementor factory) { 21 List list = (List ) item; 22 return new CollectionCacheEntry( list.toArray( new Serializable [list.size()] ) ); 23 } 24 25 } 26 | Popular Tags |