All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.hibernate.cache.entry.StructuredCollectionCacheEntry Maven / Gradle / Ivy

There is a newer version: 4.2.4
Show newest version
//$Id: StructuredCollectionCacheEntry.java 5707 2005-02-13 12:47:01Z oneovthafew $
package org.hibernate.cache.entry;

import java.io.Serializable;
import java.util.Arrays;
import java.util.List;

import org.hibernate.engine.SessionFactoryImplementor;

/**
 * @author Gavin King
 */
public class StructuredCollectionCacheEntry implements CacheEntryStructure {

	public Object structure(Object item) {
		CollectionCacheEntry entry = (CollectionCacheEntry) item;
		return Arrays.asList( entry.getState() );
	}
	
	public Object destructure(Object item, SessionFactoryImplementor factory) {
		List list = (List) item;
		return new CollectionCacheEntry( list.toArray( new Serializable[list.size()] ) );
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy