Package org.ivoa.dm.proposal.management
Class AllocatedProposal
java.lang.Object
org.ivoa.dm.proposal.management.AllocatedProposal
- All Implemented Interfaces:
org.ivoa.vodml.jpa.JPAManipulations
,org.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>
@Entity
@VoDml(id="proposalManagement:AllocatedProposal",
role=objectType)
public class AllocatedProposal
extends Object
implements org.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>
an instance of a proposal that is allocated observing time.
objectType: AllocatedProposal
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A builder class for AllocatedProposal, mainly for use in the functional builder pattern. -
Field Summary
Modifier and TypeFieldDescriptionprotected Long
inserted database keyprotected List<AllocatedBlock>
what is allocated to the proposal.protected SubmittedProposal
ReferenceObject submitted : the proposal. -
Constructor Summary
ConstructorDescriptionCreates a new AllocatedProposalCopy Constructor.AllocatedProposal
(SubmittedProposal submitted, List<AllocatedBlock> allocation) full parameter constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a org.ivoa.dm.proposal.management.AllocatedBlock to the composition.static AllocatedProposal
create a AllocatedProposal in functional builder style.void
Returns allocation composition as an immutable list.getId()
Returns submitted 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
Remove a org.ivoa.dm.proposal.management.AllocatedBlock from the composition.void
update a org.ivoa.dm.proposal.management.AllocatedBlock in the composition.void
setAllocation
(List<AllocatedBlock> pAllocation) Defines whole allocation composition.void
setSubmitted
(SubmittedProposal pSubmitted) Defines submitted Referencevoid
updates any cloned references that are contained within the hierarchy.void
updateUsing
(AllocatedProposal other) Update this object with the content of the given object.
-
Field Details
-
_id
inserted database key -
allocation
@VoDml(id="proposalManagement:AllocatedProposal.allocation", role=composition, type="proposalManagement:AllocatedBlock", typeRole=objectType) protected List<AllocatedBlock> allocationwhat is allocated to the proposal. composition allocation : ( Multiplicity : 1..* ) -
submitted
@VoDml(id="proposalManagement:AllocatedProposal.submitted", role=reference, type="proposalManagement:SubmittedProposal", typeRole=objectType) protected SubmittedProposal submittedReferenceObject submitted : the proposal. ( Multiplicity : 1 )
-
-
Constructor Details
-
AllocatedProposal
public AllocatedProposal()Creates a new AllocatedProposal -
AllocatedProposal
full parameter constructor.- Parameters:
submitted
- the proposal.allocation
- what is allocated to the proposal.
-
AllocatedProposal
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
-
updateClonedReferences
public void updateClonedReferences()updates any cloned references that are contained within the hierarchy. -
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.
-
getSubmitted
Returns submitted Reference- Returns:
- submitted Reference
-
setSubmitted
Defines submitted Reference- Parameters:
pSubmitted
- reference to set
-
getAllocation
Returns allocation composition as an immutable list.- Returns:
- allocation composition.
-
setAllocation
Defines whole allocation composition.- Parameters:
pAllocation
- composition to set.
-
addToAllocation
Add a org.ivoa.dm.proposal.management.AllocatedBlock to the composition.- Parameters:
p
- org.ivoa.dm.proposal.management.AllocatedBlock to add
-
removeFromAllocation
Remove a org.ivoa.dm.proposal.management.AllocatedBlock from the composition.- Parameters:
p
- org.ivoa.dm.proposal.management.AllocatedBlock to remove
-
replaceInAllocation
update a org.ivoa.dm.proposal.management.AllocatedBlock in the composition.- Parameters:
_p
- org.ivoa.dm.proposal.management.AllocatedBlock to update the match is done via the database key
-
createAllocatedProposal
public static AllocatedProposal createAllocatedProposal(Consumer<AllocatedProposal.AllocatedProposalBuilder> f) create a AllocatedProposal 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
-