Package org.ivoa.dm.caom2
Class Entity
java.lang.Object
org.ivoa.dm.caom2.Entity
- All Implemented Interfaces:
org.ivoa.vodml.jpa.JPAManipulations,org.ivoa.vodml.jpa.JPAManipulationsForObjectType<String>
- Direct Known Subclasses:
ArtifactDescription,CaomEntity,DeletedArtifactDescriptionEvent,DeletedObservationEvent
@Entity
@VoDml(id="caom2:Entity",
role=objectType)
public abstract class Entity
extends Object
implements org.ivoa.vodml.jpa.JPAManipulationsForObjectType<String>
This is a base class to persistence. The entity attributes are generally set
or updated by persistence implementations.
objectType: Entity
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringThe id is a globally unique identifier (primary key) for an instance.protected DateThe timestamp of last modification of this entity tracks changes in metadata and supports incremental operations.protected StringThis checksum of the metadata in this entity signals a change in the metadata of an instance and supports validation (e.g.protected StringThis identifier is used to identify the tools used to produce the metadata. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract EntitycopyMe()make a clone of the object taking into account current polymorhic type.voidgetId()Returns id Attribute.Returns lastModified Attribute.Returns metaChecksum Attribute.Returns metaProducer Attribute.voidSet id Attribute.voidsetLastModified(Date pLastModified) Set lastModified Attribute.voidsetMetaChecksum(String pMetaChecksum) Set metaChecksum Attribute.voidsetMetaProducer(String pMetaProducer) Set metaProducer Attribute.voidupdateUsing(Entity other) Update this object with the content of the given object.fluent setter for id Attribute.withLastModified(Date pLastModified) fluent setter for lastModified Attribute.withMetaChecksum(String pMetaChecksum) fluent setter for metaChecksum Attribute.withMetaProducer(String pMetaProducer) fluent setter for metaProducer Attribute.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ivoa.vodml.jpa.JPAManipulationsForObjectType
delete
-
Field Details
-
id
@VoDml(id="caom2:Entity.id", role=attribute, type="caom2:uuid", typeRole=primitiveType) protected String idThe id is a globally unique identifier (primary key) for an instance. : Attribute id : multiplicity 1 -
lastModified
@VoDml(id="caom2:Entity.lastModified", role=attribute, type="ivoa:datetime", typeRole=primitiveType) protected Date lastModifiedThe timestamp of last modification of this entity tracks changes in metadata and supports incremental operations. The timestamp is intended to be set and/or updated when the entity is stored (e.g. in a database). : Attribute lastModified : multiplicity 0..1 -
metaChecksum
@VoDml(id="caom2:Entity.metaChecksum", role=attribute, type="ivoa:anyURI", typeRole=primitiveType) protected String metaChecksumThis checksum of the metadata in this entity signals a change in the metadata of an instance and supports validation (e.g. to compare metadata before and after serialisation or persistence). A change in the metaChecksum can also be used to optimise operations like updating a row in the database only when the metaChecksum changed. A change in metaChecksum normally triggers a change in the lastModified timestamp. The URI must conform to the pattern {algorithm}:{hex value}, for example: \begin{verbatim}md5:4be91751541fd804e7207663a0822f56.\end{verbatim} The checksum of an entity is computed by accumulating byte representation of individual metadata values in the following order: (1) Entity.id for entities, (2) Entity.metaProducer, (3) state fields in alphabetic order (foo.a comes before foo.b) and using depth-first recursion (foo.abc.x comes before foo.def). The lastModified timestamp is not included in the metaChecksum calculation. Null values are ignored so that the addition of new fields in future versions will not change/invalidate existing checksums. Non-null values are converted to bytes as follows: \begin{itemize} \item string: UTF-8 encoded bytes \item URI: UTF-8 encoded bytes of the string representation \item VocabularyTerm: UTF-8 encoded bytes of the term (do not include the namespace) \item enumeration: the literal value converted to bytes \item float: IEEE754 single (4 bytes) \item double: IEEE754 double (8 bytes) \item boolean: convert to single byte, false=0, true=1 (1 byte) \item byte: as-is (1 byte) \item short: (2 bytes, network byte order == big endian)) \item integer: (4 bytes, network byte order == big endian) \item long: (8 bytes, network byte order == big endian) \item date: treat as a long (milliseconds since 1970-01-01 00:00:00 UTC) \end{itemize} TODO: truncatedDates=false, digestFieldNames=true, digestFieldnamesLowerCase=true TODO: external data model components: recursion or specify conversion above (interval, point, shape, multishape) . : Attribute metaChecksum : multiplicity 0..1 -
metaProducer
@VoDml(id="caom2:Entity.metaProducer", role=attribute, type="ivoa:anyURI", typeRole=primitiveType) protected String metaProducerThis identifier is used to identify the tools used to produce the metadata. It also implicitly applies to child entities with null metaProducer. The form of the URI is not specified; implementations are free to use this to track metadata curation. For example, a pattern like {organisation}:{software name}-{version} is useful to support a variety of operational uses: query for metadata created by a version with a known bug or query for metadata created by an older version of the software and perform updates. : Attribute metaProducer : multiplicity 0..1
-
-
Constructor Details
-
Entity
public Entity()Creates a new Entity -
Entity
full parameter constructor.- Parameters:
id- The id is a globally unique identifier (primary key) for an instance.lastModified- The timestamp of last modification of this entity tracks changes in metadata and supports incremental operations. The timestamp is intended to be set and/or updated when the entity is stored (e.g. in a database).metaChecksum- This checksum of the metadata in this entity signals a change in the metadata of an instance and supports validation (e.g. to compare metadata before and after serialisation or persistence). A change in the metaChecksum can also be used to optimise operations like updating a row in the database only when the metaChecksum changed. A change in metaChecksum normally triggers a change in the lastModified timestamp. The URI must conform to the pattern {algorithm}:{hex value}, for example: \begin{verbatim}md5:4be91751541fd804e7207663a0822f56.\end{verbatim} The checksum of an entity is computed by accumulating byte representation of individual metadata values in the following order: (1) Entity.id for entities, (2) Entity.metaProducer, (3) state fields in alphabetic order (foo.a comes before foo.b) and using depth-first recursion (foo.abc.x comes before foo.def). The lastModified timestamp is not included in the metaChecksum calculation. Null values are ignored so that the addition of new fields in future versions will not change/invalidate existing checksums. Non-null values are converted to bytes as follows: \begin{itemize} \item string: UTF-8 encoded bytes \item URI: UTF-8 encoded bytes of the string representation \item VocabularyTerm: UTF-8 encoded bytes of the term (do not include the namespace) \item enumeration: the literal value converted to bytes \item float: IEEE754 single (4 bytes) \item double: IEEE754 double (8 bytes) \item boolean: convert to single byte, false=0, true=1 (1 byte) \item byte: as-is (1 byte) \item short: (2 bytes, network byte order == big endian)) \item integer: (4 bytes, network byte order == big endian) \item long: (8 bytes, network byte order == big endian) \item date: treat as a long (milliseconds since 1970-01-01 00:00:00 UTC) \end{itemize} TODO: truncatedDates=false, digestFieldNames=true, digestFieldnamesLowerCase=true TODO: external data model components: recursion or specify conversion above (interval, point, shape, multishape) .metaProducer- This identifier is used to identify the tools used to produce the metadata. It also implicitly applies to child entities with null metaProducer. The form of the URI is not specified; implementations are free to use this to track metadata curation. For example, a pattern like {organisation}:{software name}-{version} is useful to support a variety of operational uses: query for metadata created by a version with a known bug or query for metadata created by an older version of the software and perform updates.
-
Entity
Copy Constructor. Note that references will remain as is rather than be copied.- Parameters:
other- the object to be copied.
-
-
Method Details
-
copyMe
make a clone of the object taking into account current polymorhic type.- Returns:
- the cloned object.
-
updateUsing
Update this object with the content of the given object. Note that references will remain as is rather than be copied.- Parameters:
other- the object to be copied.
-
getId
Returns id Attribute.- Specified by:
getIdin interfaceorg.ivoa.vodml.jpa.JPAManipulationsForObjectType<String>- Returns:
- id Attribute
-
setId
Set id Attribute.- Parameters:
pId- value to set
-
withId
fluent setter for id Attribute.- Parameters:
pId- value to set- Returns:
- Entity
-
getLastModified
Returns lastModified Attribute.- Returns:
- lastModified Attribute
-
setLastModified
Set lastModified Attribute.- Parameters:
pLastModified- value to set
-
withLastModified
fluent setter for lastModified Attribute.- Parameters:
pLastModified- value to set- Returns:
- Entity
-
getMetaChecksum
Returns metaChecksum Attribute.- Returns:
- metaChecksum Attribute
-
setMetaChecksum
Set metaChecksum Attribute.- Parameters:
pMetaChecksum- value to set
-
withMetaChecksum
fluent setter for metaChecksum Attribute.- Parameters:
pMetaChecksum- value to set- Returns:
- Entity
-
getMetaProducer
Returns metaProducer Attribute.- Returns:
- metaProducer Attribute
-
setMetaProducer
Set metaProducer Attribute.- Parameters:
pMetaProducer- value to set
-
withMetaProducer
fluent setter for metaProducer Attribute.- Parameters:
pMetaProducer- value to set- Returns:
- Entity
-
forceLoad
public void forceLoad()- Specified by:
forceLoadin interfaceorg.ivoa.vodml.jpa.JPAManipulations
-