com.fasterxml.jackson.module.hibernate.PersistentCollectionSerializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jackson-module-hibernate Show documentation
Show all versions of jackson-module-hibernate Show documentation
Add-on module for Jackson (http://jackson.codehaus.org) to support
Hibernate (http://hibernate.org) data types.
package com.fasterxml.jackson.module.hibernate;
import java.io.IOException;
import org.hibernate.collection.PersistentCollection;
import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.*;
import org.codehaus.jackson.type.JavaType;
/**
* Wrapper serializer used to handle aspects of lazy loading that can be used
* for Hibernate collection datatypes.
*/
public class PersistentCollectionSerializer
extends JsonSerializer
implements ContextualSerializer,
ResolvableSerializer
{
/**
* Property that has collection value to handle
*/
protected final BeanProperty _property;
protected final boolean _forceLazyLoading;
/**
* This is the nominal type used to locate actual serializer to use
* for contents, if this collection is to be serialized.
*/
protected final JavaType _serializationType;
/**
* Serializer to which we delegate if serialization is not blocked.
*/
protected JsonSerializer