Auto increment column i JDO, GAE
- by Viktor
Hi,
I have a data class with some fields, one is a URL that I consider the PK, if I add a new item (do a new sync) and save it it should overwrite the item in the database if it's the same URL. But I also need a "normal" Long id that is incremented for every object in the database and for this one I always get null unless I tags it as a PK, how can a get this incrementation but not have the column as my PK?
@Persistent(valueStrategy=IdGeneratorStrategy.IDENTITY)
private Long _id;
@Persistent
private String _title;
@PrimaryKey
@Persistent
private String _url;
/Viktor