The ListViewTag class serialises the entire data object, even if those fields aren't used in the ListView. I'm using a Hibernate entity which uses a list of objects from a many-to-many relationship and I only want to retrieve these when I need them. When the Serializer class tries to serialise the object then Hibernate tries to populate the list but it can't because there is no database session open.
Is there any way fields can be ignored by the com.kendoui.taglib.json.Serializer?
See stack trace:
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.syngenta.combichem.model.CcwEnumeration.buildingBlocks, could not initialize proxy - no Session
org.hibernate.collection.internal.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:575)
org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:214)
org.hibernate.collection.internal.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:554)
org.hibernate.collection.internal.AbstractPersistentCollection.read(AbstractPersistentCollection.java:142)
org.hibernate.collection.internal.PersistentSet.iterator(PersistentSet.java:180)
com.kendoui.taglib.json.Serializer.serializeIterable(Serializer.java:171)
com.kendoui.taglib.json.Serializer.serialize(Serializer.java:109)
com.kendoui.taglib.json.Serializer.serializeMap(Serializer.java:158)
com.kendoui.taglib.json.Serializer.serialize(Serializer.java:121)
com.kendoui.taglib.json.Serializer.serializeIterable(Serializer.java:174)
com.kendoui.taglib.json.Serializer.serialize(Serializer.java:109)
com.kendoui.taglib.json.Serializer.serializeMap(Serializer.java:158)
com.kendoui.taglib.json.Serializer.serialize(Serializer.java:113)
com.kendoui.taglib.json.Serializer.serializeMap(Serializer.java:158)
com.kendoui.taglib.json.Serializer.serialize(Serializer.java:111)
com.kendoui.taglib.WidgetTag.script(WidgetTag.java:101)
com.kendoui.taglib.WidgetTag.doEndTag(WidgetTag.java:61)
com.kendoui.taglib.ListViewTag.doEndTag(ListViewTag.java:82)