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 Attribute.getId()
getType()
Returns type Referencevoid
persistRefs
(jakarta.persistence.EntityManager _em) Deprecated.generally better to use the model level reference persistence as only this can deal with "contained" references properly.void
Set amount Attribute.void
setType
(ResourceType pType) Defines type Referencevoid
updateUsing
(Resource other) Update this object with the content of the given object.withAmount
(Double pAmount) fluent setter for amount Attribute.
-
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
Set amount Attribute.- Parameters:
pAmount
- value to set
-
withAmount
fluent setter for amount Attribute.- Parameters:
pAmount
- value to set- Returns:
- Resource
-
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
-
persistRefs
Deprecated.generally better to use the model level reference persistence as only this can deal with "contained" references properly.- Specified by:
persistRefs
in interfaceorg.ivoa.vodml.jpa.JPAManipulations
-