1 package org.sourceforge.jemm.database.persistent.berkeley.objects; 2 3 import com.sleepycat.persist.model.Entity; 4 import com.sleepycat.persist.model.PrimaryKey; 5 import com.sleepycat.persist.model.Relationship; 6 import com.sleepycat.persist.model.SecondaryKey; 7 8 import org.sourceforge.jemm.database.ClientId; 9 import org.sourceforge.jemm.types.ID; 10 11 @Entity 12 public class ClientRefInfo { 13 @PrimaryKey 14 protected ClientRefKey key; 15 16 @SecondaryKey(relate=Relationship.MANY_TO_ONE) 17 protected String clientId; 18 19 @SecondaryKey(relate=Relationship.MANY_TO_ONE) 20 protected long objectId; 21 22 public ClientRefInfo(ClientId clientId, ID id) { 23 key = new ClientRefKey(clientId,id); 24 this.clientId = clientId.getInternalRep(); 25 this.objectId = id.getIDValue(); 26 } 27 28 public ClientRefInfo() {} 29 30 public ID getObjectId() { 31 return new ID(objectId); 32 } 33 }