Package ca.uhn.fhir.jpa.model.entity
Class ResourceTable
java.lang.Object
ca.uhn.fhir.jpa.model.entity.BasePartitionable
ca.uhn.fhir.jpa.model.entity.BaseHasResource
ca.uhn.fhir.jpa.model.entity.ResourceTable
- All Implemented Interfaces:
IBasePersistedResource<JpaPid>
,IResourceLookup<JpaPid>
,IBaseResourceEntity
,Serializable
@Indexed(routingBinder=@RoutingBinderRef(type=ResourceTableRoutingBinder.class))
@Entity
public class ResourceTable
extends BaseHasResource
implements Serializable, IBasePersistedResource<JpaPid>
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Populate myFhirId with server-assigned sequence id when no client-id provided. -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final int
static final String
static final int
Fields inherited from class ca.uhn.fhir.jpa.model.entity.BaseHasResource
RES_PUBLISHED, RES_UPDATED
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddTag
(TagDefinition theTag) void
Clears all the index population flags, e.g.This is a convenience to avoid loading the version a second time within a single transaction.Get the FHIR resource id.getId()
ca.uhn.fhir.model.primitive.IdDt
getIdDt()
org.hl7.fhir.instance.model.api.IIdType
getIdType
(ca.uhn.fhir.context.FhirContext theContext) getTags()
long
void
Sets the version on this entity to 1.boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
Transient (not saved in DB) flag indicating that this resource was found to be unchanged by the current operation and was not re-saved in the databaseboolean
void
Setting this flag is an indication that we're making changes and the version number will be incremented in the current transaction.void
populateHistoryEntityVersionAndDates
(ResourceHistoryTable theResourceHistoryTable) Updates several temporal values in aResourceHistoryTable
entity which are pulled from this entity, including the resource version, and the creation, update, and deletion dates.void
void
preSave()
void
setContentText
(String theContentText) void
setCreatedByMatchUrl
(String theCreatedByMatchUrl) void
setCurrentVersionEntity
(ResourceHistoryTable theCurrentVersionEntity) This is a convenience to avoid loading the version a second time within a single transaction.void
void
setHashSha256
(String theHashSha256) void
setHasLinks
(boolean theHasLinks) void
void
setIndexStatus
(Long theIndexStatus) void
setLuceneIndexData
(ExtendedHSearchIndexData theLuceneIndexData) void
setNarrativeText
(String theNarrativeText) void
void
setParamsComboStringUniquePresent
(boolean theParamsComboStringUniquePresent) void
setParamsComboTokensNonUniquePresent
(boolean theParamsComboTokensNonUniquePresent) void
setParamsCoords
(Collection<ResourceIndexedSearchParamCoords> theParamsCoords) void
setParamsCoordsPopulated
(boolean theParamsCoordsPopulated) void
setParamsDate
(Collection<ResourceIndexedSearchParamDate> theParamsDate) void
setParamsDatePopulated
(boolean theParamsDatePopulated) void
setParamsNumber
(Collection<ResourceIndexedSearchParamNumber> theNumberParams) void
setParamsNumberPopulated
(boolean theParamsNumberPopulated) void
setParamsQuantity
(Collection<ResourceIndexedSearchParamQuantity> theQuantityParams) void
setParamsQuantityNormalized
(Collection<ResourceIndexedSearchParamQuantityNormalized> theQuantityNormalizedParams) void
setParamsQuantityNormalizedPopulated
(Boolean theParamsQuantityNormalizedPopulated) void
setParamsQuantityPopulated
(boolean theParamsQuantityPopulated) void
setParamsString
(Collection<ResourceIndexedSearchParamString> theParamsString) void
setParamsStringPopulated
(boolean theParamsStringPopulated) void
setParamsToken
(Collection<ResourceIndexedSearchParamToken> theParamsToken) void
setParamsTokenPopulated
(boolean theParamsTokenPopulated) void
setParamsUri
(Collection<ResourceIndexedSearchParamUri> theParamsUri) void
setParamsUriPopulated
(boolean theParamsUriPopulated) void
setResourceLinks
(Collection<ResourceLink> theLinks) setResourceType
(String theResourceType) void
setSearchUrlPresent
(boolean theSearchUrlPresent) void
setUnchangedInCurrentOperation
(boolean theUnchangedInCurrentOperation) Transient (not saved in DB) flag indicating that this resource was found to be unchanged by the current operation and was not re-saved in the databasevoid
setUpdatedByMatchUrl
(String theUpdatedByMatchUrl) void
setVersionForUnitTest
(long theVersion) Don't call this in any JPA environments, the version will be ignored since this field is managed by hibernatetoHistory
(boolean theCreateVersionTags) This method creates a new history entity, or might reuse the current one if we've already created one in the current transaction.toString()
Methods inherited from class ca.uhn.fhir.jpa.model.entity.BaseHasResource
getDeleted, getFhirVersion, getPublished, getPublishedDate, getUpdated, getUpdatedDate, isHasTags, setDeleted, setFhirVersion, setHasTags, setPublished, setPublished, setUpdated
Methods inherited from class ca.uhn.fhir.jpa.model.entity.BasePartitionable
getPartitionId, setPartitionId
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface ca.uhn.fhir.jpa.model.entity.IBaseResourceEntity
getPartitionId
Methods inherited from interface ca.uhn.fhir.jpa.model.cross.IResourceLookup
getDeleted
-
Field Details
-
RESTYPE_LEN
- See Also:
-
HFJ_RESOURCE
- See Also:
-
RES_TYPE
- See Also:
-
FHIR_ID
- See Also:
-
MAX_FORCED_ID_LENGTH
- See Also:
-
IDX_RES_TYPE_FHIR_ID
- See Also:
-
-
Constructor Details
-
ResourceTable
public ResourceTable()Constructor
-
-
Method Details
-
markVersionUpdatedInCurrentTransaction
Setting this flag is an indication that we're making changes and the version number will be incremented in the current transaction. When this is set, calls togetVersion()
will be incremented by one. This flag is cleared inpostPersist()
since at that time the new version number should be reflected. -
postPersist
-
addTag
- Specified by:
addTag
in classBaseHasResource
-
getHashSha256
-
setHashSha256
-
getId
- Specified by:
getId
in interfaceIBaseResourceEntity
-
setId
-
getIndexStatus
-
setIndexStatus
-
getParamsComboStringUnique
-
getmyParamsComboTokensNonUnique
-
getParamsCoords
-
setParamsCoords
-
getParamsDate
-
setParamsDate
-
getParamsNumber
-
setParamsNumber
-
getParamsQuantity
-
setParamsQuantity
-
getParamsQuantityNormalized
-
setParamsQuantityNormalized
public void setParamsQuantityNormalized(Collection<ResourceIndexedSearchParamQuantityNormalized> theQuantityNormalizedParams) -
getParamsString
-
setParamsString
-
getParamsToken
-
setParamsToken
-
getParamsUri
-
setParamsUri
-
getResourceId
- Specified by:
getResourceId
in interfaceIBaseResourceEntity
-
getResourceLinks
-
setResourceLinks
-
getResourceType
- Specified by:
getResourceType
in interfaceIBaseResourceEntity
- Specified by:
getResourceType
in interfaceIResourceLookup<JpaPid>
-
setResourceType
-
getTags
- Specified by:
getTags
in classBaseHasResource
-
getVersion
- Specified by:
getVersion
in interfaceIBasePersistedResource<JpaPid>
- Specified by:
getVersion
in interfaceIBaseResourceEntity
-
initializeVersion
Sets the version on this entity to 1. This should only be called on resources that are not yet persisted. After that time the version number is managed by hibernate. -
setVersionForUnitTest
Don't call this in any JPA environments, the version will be ignored since this field is managed by hibernate -
isDeleted
- Specified by:
isDeleted
in interfaceIBasePersistedResource<JpaPid>
-
setNotDeleted
- Specified by:
setNotDeleted
in interfaceIBasePersistedResource<JpaPid>
-
isHasLinks
-
setHasLinks
-
clearAllParamsPopulated
Clears all the index population flags, e.g.isParamsStringPopulated()
- Since:
- 6.8.0
-
isParamsComboStringUniquePresent
-
setParamsComboStringUniquePresent
-
isParamsComboTokensNonUniquePresent
-
setParamsComboTokensNonUniquePresent
-
isParamsCoordsPopulated
-
setParamsCoordsPopulated
-
isParamsDatePopulated
-
setParamsDatePopulated
-
isParamsNumberPopulated
-
setParamsNumberPopulated
-
isParamsQuantityPopulated
-
setParamsQuantityPopulated
-
isParamsQuantityNormalizedPopulated
-
setParamsQuantityNormalizedPopulated
-
isParamsStringPopulated
-
setParamsStringPopulated
-
isParamsTokenPopulated
-
setParamsTokenPopulated
-
isParamsUriPopulated
-
setParamsUriPopulated
-
isUnchangedInCurrentOperation
Transient (not saved in DB) flag indicating that this resource was found to be unchanged by the current operation and was not re-saved in the database -
setUnchangedInCurrentOperation
Transient (not saved in DB) flag indicating that this resource was found to be unchanged by the current operation and was not re-saved in the database -
getContentText
-
setContentText
-
setNarrativeText
-
isSearchUrlPresent
-
setSearchUrlPresent
-
toHistory
This method creates a new history entity, or might reuse the current one if we've already created one in the current transaction. This is because we can only increment the version once in a DB transaction (since hibernate manages that number) so creating multipleResourceHistoryTable
entities will result in a constraint error. -
populateHistoryEntityVersionAndDates
Updates several temporal values in aResourceHistoryTable
entity which are pulled from this entity, including the resource version, and the creation, update, and deletion dates. -
toString
- Overrides:
toString
in classBasePartitionable
-
preSave
-
getCurrentVersionEntity
This is a convenience to avoid loading the version a second time within a single transaction. It is not persisted. -
setCurrentVersionEntity
This is a convenience to avoid loading the version a second time within a single transaction. It is not persisted. -
getPersistentId
- Specified by:
getPersistentId
in interfaceIResourceLookup<JpaPid>
-
getIdDt
- Specified by:
getIdDt
in interfaceIBasePersistedResource<JpaPid>
- Specified by:
getIdDt
in interfaceIBaseResourceEntity
-
getIdType
public org.hl7.fhir.instance.model.api.IIdType getIdType(ca.uhn.fhir.context.FhirContext theContext) -
getCreatedByMatchUrl
-
setCreatedByMatchUrl
-
getUpdatedByMatchUrl
-
setUpdatedByMatchUrl
-
isVersionUpdatedInCurrentTransaction
-
setLuceneIndexData
-
getSearchParamPresents
-
getFhirId
Get the FHIR resource id.- Returns:
- the resource id, or null if the resource doesn't have a client-assigned id, and hasn't been saved to the db to get a server-assigned id yet.
-
setFhirId
-
asTypedFhirResourceId
-