Package ca.uhn.fhir.jpa.model.dao
Class JpaPid
java.lang.Object
ca.uhn.fhir.rest.api.server.storage.BaseResourcePersistentId<Long>
ca.uhn.fhir.jpa.model.dao.JpaPid
- All Implemented Interfaces:
ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId<Long>
,Comparable<JpaPid>
@Embeddable
public class JpaPid
extends ca.uhn.fhir.rest.api.server.storage.BaseResourcePersistentId<Long>
implements Comparable<JpaPid>
JPA implementation of IResourcePersistentId. JPA uses a Long as the primary key. This class should be used in any
context where the pid is known to be a Long.
-
Field Summary
Fields inherited from interface ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId
NOT_FOUND
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
boolean
Note that equals and hashCode for this object only consider the ID and Partition ID because this class gets used as cache keysstatic JpaPid
fromId
(IdAndPartitionId theId) static JpaPid
static JpaPid
fromId
(Long theResourceId, PartitionablePartitionId thePartitionId) static JpaPid
static JpaPid
fromIdAndResourceType
(Long theId, String theResourceType) static JpaPid
fromIdAndVersion
(Long theId, Long theVersion) static JpaPid
fromIdAndVersionAndResourceType
(Long theId, Long theVersion, String theResourceType) fromLongList
(Collection<Long> theResultList) getId()
int
hashCode()
Note that equals and hashCode for this object only consider the ID and Partition ID because this class gets used as cache keysvoid
setPartitionablePartitionId
(PartitionablePartitionId thePartitionablePartitionId) void
setPartitionId
(Integer thePartitionId) setPartitionIdIfNotAlreadySet
(Integer thePartitionId) toFk()
toLongList
(JpaPid[] thePids) toLongList
(Collection<JpaPid> thePids) toLongSet
(Collection<JpaPid> thePids) toString()
Methods inherited from class ca.uhn.fhir.rest.api.server.storage.BaseResourcePersistentId
getAssociatedResourceId, getResourceType, getVersion, setAssociatedResourceId, setResourceType, setVersion
-
Constructor Details
-
JpaPid
public JpaPid()Constructor - Do not call this directly, only used for JPA instantiation -
JpaPid
-
-
Method Details
-
getPartitionablePartitionId
-
setPartitionablePartitionId
-
setPartitionIdIfNotAlreadySet
-
getPartitionId
- Specified by:
getPartitionId
in interfaceca.uhn.fhir.rest.api.server.storage.IResourcePersistentId<Long>
-
setPartitionId
-
equals
Note that equals and hashCode for this object only consider the ID and Partition ID because this class gets used as cache keys- Overrides:
equals
in classca.uhn.fhir.rest.api.server.storage.BaseResourcePersistentId<Long>
-
hashCode
Note that equals and hashCode for this object only consider the ID and Partition ID because this class gets used as cache keys- Overrides:
hashCode
in classca.uhn.fhir.rest.api.server.storage.BaseResourcePersistentId<Long>
-
getId
- Specified by:
getId
in interfaceca.uhn.fhir.rest.api.server.storage.IResourcePersistentId<Long>
-
setId
-
toString
-
compareTo
- Specified by:
compareTo
in interfaceComparable<JpaPid>
-
toFk
-
toLongList
-
toLongList
-
toLongSet
-
fromLongList
-
fromId
-
fromId
-
fromId
-
fromIdAndVersion
-
fromIdAndResourceType
-
fromIdAndVersionAndResourceType
public static JpaPid fromIdAndVersionAndResourceType(Long theId, Long theVersion, String theResourceType) -
fromId
-