Skip to content

Commit

Permalink
Trying to fix #36
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Oct 18, 2013
1 parent 1364bc2 commit 46bff65
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ public void serializeWithType(Object value, JsonGenerator jgen, SerializerProvid
protected boolean usesLazyLoading(BeanProperty property)
{
if (property != null) {
// As per [Issue#36]
ElementCollection ec = property.getAnnotation(ElementCollection.class);
if (ec != null) {
return (ec.fetch() == FetchType.LAZY);
}
OneToMany ann1 = property.getAnnotation(OneToMany.class);
if (ann1 != null) {
return (ann1.fetch() == FetchType.LAZY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@

import java.io.IOException;

import javax.persistence.FetchType;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.*;

import org.hibernate.collection.spi.PersistentCollection;


import com.fasterxml.jackson.core.*;

import com.fasterxml.jackson.databind.*;
Expand Down Expand Up @@ -141,6 +136,11 @@ public void serializeWithType(Object value, JsonGenerator jgen, SerializerProvid
protected boolean usesLazyLoading(BeanProperty property)
{
if (property != null) {
// As per [Issue#36]
ElementCollection ec = property.getAnnotation(ElementCollection.class);
if (ec != null) {
return (ec.fetch() == FetchType.LAZY);
}
OneToMany ann1 = property.getAnnotation(OneToMany.class);
if (ann1 != null) {
return (ann1.fetch() == FetchType.LAZY);
Expand Down

0 comments on commit 46bff65

Please sign in to comment.