Package org.ivoa.dm.proposal.management
Class Resource
java.lang.Object
org.ivoa.dm.proposal.management.Resource
- All Implemented Interfaces:
org.ivoa.vodml.jpa.JPAManipulations
,org.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>
@Entity
@VoDml(id="proposalManagement:Resource",
role=objectType)
public class Resource
extends Object
implements org.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>
A resource that will be consumed by allocating an observation from a proposal.
objectType: Resource
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A builder class for Resource, mainly for use in the functional builder pattern. -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Resource
create a Resource in functional builder style.void
Returns amount AttributegetId()
getType()
Returns type Referencevoid
jpaClone
(jakarta.persistence.EntityManager em) void
persistRefs
(jakarta.persistence.EntityManager _em) void
Defines amount Attributevoid
setType
(ResourceType pType) Defines type Referencevoid
updateUsing
(Resource other) Update this object with the content of the given object.withAmount
(Double pAmount)
-
Field Details
-
_id
inserted database key -
amount
@VoDml(id="proposalManagement:Resource.amount", role=attribute, type="ivoa:real", typeRole=primitiveType) protected Double amountThe amount of the resource. : Attribute amount : multiplicity 1 -
type
@VoDml(id="proposalManagement:Resource.type", role=reference, type="proposalManagement:ResourceType", typeRole=objectType) protected ResourceType typeReferenceObject type : the type of the resource. ( Multiplicity : 1 )
-
-
Constructor Details
-
Resource
public Resource()Creates a new Resource -
Resource
full parameter constructor.- Parameters:
type
- the type of the resource.amount
- The amount of the resource.
-
Resource
Copy Constructor. Note that references will remain as is rather than be copied.- Parameters:
other
- the object to be copied.
-
-
Method Details
-
getId
- Specified by:
getId
in interfaceorg.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>
- Returns:
- the id
-
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.
-
getType
Returns type Reference- Returns:
- type Reference
-
setType
Defines type Reference- Parameters:
pType
- reference to set
-
getAmount
Returns amount Attribute- Returns:
- amount Attribute
-
setAmount
Defines amount Attribute- Parameters:
pAmount
- value to set
-
withAmount
-
createResource
create a Resource in functional builder style.- Parameters:
f
- the functional builder.- Returns:
- an object initialized from the builder.
-
forceLoad
public void forceLoad()- Specified by:
forceLoad
in interfaceorg.ivoa.vodml.jpa.JPAManipulations
-
jpaClone
public void jpaClone(jakarta.persistence.EntityManager em) - Specified by:
jpaClone
in interfaceorg.ivoa.vodml.jpa.JPAManipulations
-
persistRefs
public void persistRefs(jakarta.persistence.EntityManager _em) - Specified by:
persistRefs
in interfaceorg.ivoa.vodml.jpa.JPAManipulations
-