
Package ca.uhn.fhir.jpa.model.entity
Class ResourceTable
- All Implemented Interfaces:
 IBasePersistedResource<JpaPid>,IResourceLookup<JpaPid>,IBaseResourceEntity<JpaPid>,Serializable
@Indexed(routingBinder=@RoutingBinderRef(type=ResourceTableRoutingBinder.class))
@Entity
public class ResourceTable
extends BaseHasResource<JpaPid>
implements Serializable, IBasePersistedResource<JpaPid>
- See Also:
 
- 
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classPopulate myFhirId with server-assigned sequence id when no client-id provided. - 
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final intstatic final Stringstatic final Stringstatic final intstatic final Stringstatic final intFields inherited from class ca.uhn.fhir.jpa.model.entity.BaseHasResource
RES_PUBLISHED, RES_UPDATED - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionaddTag(TagDefinition theTag) voidClears 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.IdDtgetIdDt()Returns a newly created IdDt containing the resource ID, ornullif the ID is not yet known (e.g. if this entity will have a server-assigned ID which has not yet been assigned).org.hl7.fhir.instance.model.api.IIdTypegetIdType(ca.uhn.fhir.context.FhirContext theContext) Returns a newly created IdType containing the resource ID, ornullif the ID is not yet known (e.g. if this entity will have a server-assigned ID which has not yet been assigned).getTags()longvoidSets the version on this entity to 1.booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanTransient (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 databasebooleanvoidSetting this flag is an indication that we're making changes and the version number will be incremented in the current transaction.voidpopulateHistoryEntityVersionAndDates(ResourceHistoryTable theResourceHistoryTable) Updates several temporal values in aResourceHistoryTableentity which are pulled from this entity, including the resource version, and the creation, update, and deletion dates.voidvoidpreSave()voidsetContentText(String theContentText) voidsetCreatedByMatchUrl(String theCreatedByMatchUrl) voidsetCurrentVersionEntity(ResourceHistoryTable theCurrentVersionEntity) This is a convenience to avoid loading the version a second time within a single transaction.voidvoidsetHashSha256(String theHashSha256) voidsetHasLinks(boolean theHasLinks) voidvoidsetIdForUnitTest(Long theId) voidsetIndexStatus(EntityIndexStatusEnum theIndexStatus) voidsetLuceneIndexData(ExtendedHSearchIndexData theLuceneIndexData) voidsetNarrativeText(String theNarrativeText) voidvoidsetParamsComboStringUnique(Collection<ResourceIndexedComboStringUnique> theComboStringUniques) voidsetParamsComboStringUniquePresent(boolean theParamsComboStringUniquePresent) voidsetParamsComboTokensNonUnique(Collection<ResourceIndexedComboTokenNonUnique> theComboTokensNonUnique) voidsetParamsComboTokensNonUniquePresent(boolean theParamsComboTokensNonUniquePresent) voidsetParamsCoords(Collection<ResourceIndexedSearchParamCoords> theParamsCoords) voidsetParamsCoordsPopulated(boolean theParamsCoordsPopulated) voidsetParamsDate(Collection<ResourceIndexedSearchParamDate> theParamsDate) voidsetParamsDatePopulated(boolean theParamsDatePopulated) voidsetParamsNumber(Collection<ResourceIndexedSearchParamNumber> theNumberParams) voidsetParamsNumberPopulated(boolean theParamsNumberPopulated) voidsetParamsQuantity(Collection<ResourceIndexedSearchParamQuantity> theQuantityParams) voidsetParamsQuantityNormalized(Collection<ResourceIndexedSearchParamQuantityNormalized> theQuantityNormalizedParams) voidsetParamsQuantityNormalizedPopulated(Boolean theParamsQuantityNormalizedPopulated) voidsetParamsQuantityPopulated(boolean theParamsQuantityPopulated) voidsetParamsString(Collection<ResourceIndexedSearchParamString> theParamsString) voidsetParamsStringPopulated(boolean theParamsStringPopulated) voidsetParamsToken(Collection<ResourceIndexedSearchParamToken> theParamsToken) voidsetParamsTokenPopulated(boolean theParamsTokenPopulated) voidsetParamsUri(Collection<ResourceIndexedSearchParamUri> theParamsUri) voidsetParamsUriPopulated(boolean theParamsUriPopulated) voidsetPartitionId(PartitionablePartitionId theStoragePartition) voidsetResourceLinks(Collection<ResourceLink> theLinks) setResourceType(String theResourceType) voidsetResourceTypeId(Short theResourceTypeId) voidsetSearchUrlPresent(boolean theSearchUrlPresent) voidsetUnchangedInCurrentOperation(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 databasevoidsetUpdatedByMatchUrl(String theUpdatedByMatchUrl) voidsetVersionForUnitTest(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, setUpdatedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:
 
 - 
FHIR_ID_LENGTH
- 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:
 addTagin classBaseHasResource<JpaPid>
 - 
getHashSha256
 - 
setHashSha256
 - 
getId
- Specified by:
 getIdin interfaceIBaseResourceEntity<JpaPid>
 - 
setId
 - 
setIdForUnitTest
 - 
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:
 getResourceIdin interfaceIBaseResourceEntity<JpaPid>
 - 
getResourceLinks
 - 
setResourceLinks
 - 
getResourceType
- Specified by:
 getResourceTypein interfaceIBaseResourceEntity<JpaPid>- Specified by:
 getResourceTypein interfaceIResourceLookup<JpaPid>
 - 
setResourceType
 - 
getResourceTypeId
- Specified by:
 getResourceTypeIdin interfaceIBaseResourceEntity<JpaPid>
 - 
setResourceTypeId
 - 
getMyResourceTypeEntity
 - 
getTags
- Specified by:
 getTagsin classBaseHasResource<JpaPid>
 - 
getVersion
- Specified by:
 getVersionin interfaceIBasePersistedResource<JpaPid>- Specified by:
 getVersionin interfaceIBaseResourceEntity<JpaPid>
 - 
getPartitionId
- Specified by:
 getPartitionIdin interfaceIBaseResourceEntity<JpaPid>- Specified by:
 getPartitionIdin interfaceIResourceLookup<JpaPid>
 - 
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:
 isDeletedin interfaceIBasePersistedResource<JpaPid>
 - 
setNotDeleted
- Specified by:
 setNotDeletedin 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 multipleResourceHistoryTableentities will result in a constraint error. - 
populateHistoryEntityVersionAndDates
Updates several temporal values in aResourceHistoryTableentity which are pulled from this entity, including the resource version, and the creation, update, and deletion dates. - 
toString
 - 
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:
 getPersistentIdin interfaceIResourceLookup<JpaPid>
 - 
getIdDt
Returns a newly created IdDt containing the resource ID, ornullif the ID is not yet known (e.g. if this entity will have a server-assigned ID which has not yet been assigned).- Specified by:
 getIdDtin interfaceIBasePersistedResource<JpaPid>- Specified by:
 getIdDtin interfaceIBaseResourceEntity<JpaPid>
 - 
getIdType
public org.hl7.fhir.instance.model.api.IIdType getIdType(ca.uhn.fhir.context.FhirContext theContext) Returns a newly created IdType containing the resource ID, ornullif the ID is not yet known (e.g. if this entity will have a server-assigned ID which has not yet been assigned). - 
getCreatedByMatchUrl
 - 
setCreatedByMatchUrl
 - 
getUpdatedByMatchUrl
 - 
setUpdatedByMatchUrl
 - 
isVersionUpdatedInCurrentTransaction
 - 
setLuceneIndexData
 - 
getSearchParamPresents
 - 
getFhirId
Get the FHIR resource id.- Specified by:
 getFhirIdin interfaceIResourceLookup<JpaPid>- 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
 - 
setPartitionId
 - 
setParamsComboStringUnique
public void setParamsComboStringUnique(Collection<ResourceIndexedComboStringUnique> theComboStringUniques)  - 
setParamsComboTokensNonUnique
public void setParamsComboTokensNonUnique(Collection<ResourceIndexedComboTokenNonUnique> theComboTokensNonUnique)  
 -