surinder-insonix / datanucleus-appengine

Automatically exported from code.google.com/p/datanucleus-appengine
0 stars 0 forks source link

Support customization of type mapping (especially for SCOs) #312

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Currently almost all type mapping on entity fields is done in 
com.google.appengine.datanucleus.StoreFieldManager#storeFieldInEntity and 
com.google.appengine.datanucleus.TypeConversionUtils#pojoValueToDatastoreValue. 
This is quite unflexible, since this hinders writing custom mapping classes.

If one tries to keep ones entities free of appengine specific SCOs (like Text 
for Strings greater than 500byte for example), the only option right now is to 
use byte[] with the "serialized" property set in the metadata. In the "Text" 
example, this leads to clutter the entity with non-trivial getter/setter code, 
that does the actual conversion from String to byte[] and vice versa.

It would be great, if the current way of converting values for the targetted 
datastore (GAE in this case), was would be more tailored to the type conversion 
subsystem, as intended by DN. This would allow for greater flexibility when it 
comes to writing entities or converting existing entities to GAE.

For reference, my current setup:
* DataNucleus 3.1.1 (using JDO-API)
* Targetting two platforms:
** GAE 1.7.4 (using DataNucleus-Appengine 2.1.1)
** Standard servlet container (using Datanucleus-RDBMS)

Original issue reported on code.google.com by krupi...@synyx.de on 5 Feb 2013 at 12:56