ludoch / datanucleus-appengine

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

Enable use of int/Integer for PK fields #294

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
While v2.0 changes made this a possibility, we never disabled the checks on PK 
fields in MetaDataValidator. Just need to allow int/Integer there and all will 
work

Original issue reported on code.google.com by googleco...@yahoo.co.uk on 18 Aug 2012 at 10:17

GoogleCodeExporter commented 8 years ago
SVN trunk enables this

Original comment by googleco...@yahoo.co.uk on 18 Aug 2012 at 10:18

GoogleCodeExporter commented 8 years ago
trying to get an entity with an int field as PK I get "Received a request to 
find an object of type <myclass> identified by 2.  This is not a valid 
representation of a primary key for an instance of <myclass>".

I tried to look in the source and it seems to me that the 
intOrLongToInternalKey method
in EntityUtils class should have also a case managing Integer, something like:
(..)
    } else if (pkType.equals(Integer.class)) {
      result = keyWithId.getId();
(..)

Original comment by finsacca...@gmail.com on 19 Aug 2013 at 5:51