Enhancement 212 : ENHANCEMENT - Add "Vanilla Mode" ... where queries return plain vanilla objects
Priority 
High
Reported Version 
 
Logged By 
Rob
Status 
Fixed
Fixed Version 
2.4.0
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
28/01/2010
Updated 
28/01/2010
Type 
Enhancement
 
Attachments 
No attachments

This is not applicable when the classes are enhanced.

However, when using "dynamic subclasses" typically the objects returned from a query are actually dynamically generated subclasses that Ebean has defined. These classes support lazy loading and dirty checking etc.

The enhancement is to be able to specify on a global and per query basis to return just plain "vanilla" objects (rather than Ebean's generated subclasses, and Ebean specific Lists,Sets,Maps that are used to lazy load collections).

This means the returned object graphs have no Ebean dependencies. Obviously they don't support lazy loading, PropertyChangeSupport etc that the Ebean classes do.

 
Rob 28 Jan 09:00
Fixed in HEAD

This has been added to head now.

For a specific query ... use setVanillaMode(true)

List<Order> list = 
    Ebean.find(Order.class)
    .join("details")
    .setVanillaMode(true)
    .findList();

Otherwise to turn it on globally use ServerConfig.setVanillaMode(true) or ... in ebean.properties set

ebean.vanillaMode=true

woResponse

Upload a file