Package org.ivoa.dm.proposal.management
Class ResourceBlock
java.lang.Object
org.ivoa.dm.proposal.management.ResourceBlock
- All Implemented Interfaces:
org.ivoa.vodml.jpa.JPAManipulations
,org.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>
- Direct Known Subclasses:
AllocatedBlock
@Entity
@VoDml(id="proposalManagement:ResourceBlock",
role=objectType)
public class ResourceBlock
extends Object
implements org.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>
A block of resources that can be allocated.
objectType: ResourceBlock
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A builder class for ResourceBlock, mainly for use in the functional builder pattern. -
Field Summary
-
Constructor Summary
ConstructorDescriptionCreates a new ResourceBlockResourceBlock
(ObservingMode mode, Resource resource) full parameter constructor.ResourceBlock
(ResourceBlock other) Copy Constructor. -
Method Summary
Modifier and TypeMethodDescriptioncopyMe()
make a clone of the object taking into account current polymorhic type.static ResourceBlock
create a ResourceBlock in functional builder style.void
getId()
getMode()
Returns mode ReferenceReturns resource Attribute.void
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
setMode
(ObservingMode pMode) Defines mode Referencevoid
setResource
(Resource pResource) Set resource Attribute.void
updates any cloned references that are contained within the hierarchy.void
updateUsing
(ResourceBlock other) Update this object with the content of the given object.withResource
(Resource pResource) fluent setter for resource Attribute.
-
Field Details
-
_id
inserted database key -
resource
@VoDml(id="proposalManagement:ResourceBlock.resource", role=composition, type="proposalManagement:Resource", typeRole=objectType) protected Resource resourcethe amount of resource. composition resource : ( Multiplicity : 1 ) -
mode
@VoDml(id="proposalManagement:ResourceBlock.mode", role=reference, type="proposalManagement:ObservingMode", typeRole=objectType) protected ObservingMode modeReferenceObject mode : . ( Multiplicity : 1 )
-
-
Constructor Details
-
ResourceBlock
public ResourceBlock()Creates a new ResourceBlock -
ResourceBlock
full parameter constructor.- Parameters:
mode
- .resource
- the amount of resource.
-
ResourceBlock
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
-
copyMe
make a clone of the object taking into account current polymorhic type.- Returns:
- the cloned object.
-
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.
-
getMode
Returns mode Reference- Returns:
- mode Reference
-
setMode
Defines mode Reference- Parameters:
pMode
- reference to set
-
getResource
Returns resource Attribute.- Returns:
- resource Attribute
-
setResource
Set resource Attribute.- Parameters:
pResource
- value to set
-
withResource
fluent setter for resource Attribute.- Parameters:
pResource
- value to set- Returns:
- ResourceBlock
-
createResourceBlock
create a ResourceBlock 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
-