@Repository(value="catchBatchDao") @Lazy public class CatchBatchDaoImpl extends CatchBatchDaoBase implements CatchBatchExtendDao
CatchBatch
Modifier and Type | Field and Description |
---|---|
protected CatchBatchExtendDao |
catchBatchDao |
protected SortingBatchDao |
sortingBatchDao |
protected List<CatchBatchValidator> |
validators |
debugEntityLoad, logger
PMFM_ID, REFERENCE_TAXON_ID
TRANSFORM_NONE
Constructor and Description |
---|
CatchBatchDaoImpl(SessionFactory sessionFactory)
Constructor used by Spring
|
Modifier and Type | Method and Description |
---|---|
protected void |
applyInheritance(Collection<Batch> batchs,
List<SortingMeasurement> inheritedSortingMeasurements,
Integer inheritedTaxonGroupId,
Integer inheritedReferenceTaxonId,
boolean inheritedExhaustiveInventory,
int treeLevel) |
protected void |
applyInheritanceOnOneChild(SortingBatch parentBatch,
SortingBatch batchToUpdate) |
protected void |
computeTechnicalWeights(Batch batch) |
SortingBatch |
createSortingBatch(SortingBatch sortingBatch,
CatchBatch parentCatchBatch)
Create a new batch
|
List<Integer> |
getAllChildrenIds(Integer batchId)
Walk throw the batch given by the id and grab ids of all his shell.
|
protected void |
getAllChildrenIds(Integer batchId,
List<Integer> result) |
protected Integer |
getCatchBatchIdByBatchId(String batchId) |
Integer |
getIdByFishingOperationId(Integer fishingOperationId)
Retrieve a catch batch Id, from a fishing operation id
|
Integer |
getIdBySortingBatchId(Integer batchId)
Retrieve a catch batch Id, from a sorting batch id
|
SortingMeasurement |
getInheritedSortingMeasurement(SortingBatch sortingBatch,
Integer pmfmId) |
QuantificationMeasurement |
getQuantificationMeasurement(Batch batch,
Integer pmfmId,
Integer recorderDepartmentId,
boolean createIfNotExists) |
SortingBatch |
getSortingBatch(Collection<Batch> batchs,
Object... params)
retrieve a sorting batch, from path give in params. i.e:
getSortingBatch(sortingBatchCollection, PMFM_ID, PmfmId.SEX, QualitativeValueId.FEMALE) |
SortingBatch |
getSortingBatchById(CatchBatch catchBatch,
Integer sortingBatchId)
Retrieve a child (in all tree depth) of the given catch batch, using an sorting batch id.
|
SortingMeasurement |
getSortingMeasurement(SortingBatch sortingBatch,
Integer pmfmId,
Integer recorderDepartmentId,
boolean createIfNotExists) |
boolean |
isCatchBatchExistsForFishingOperation(Integer fishingOperationId) |
CatchBatch |
loadFullTree(Integer catchBatchId)
Load a catch batch and all its childrens.
|
CatchBatch |
loadFullTree(Integer catchBatchId,
boolean validate,
boolean quickFix)
Load a catch batch and all its childrens.
|
CatchBatch |
loadFullTreeWithCache(Integer catchBatchId,
boolean useCache,
boolean forceReload)
Method typically using by other loadFullTree() methods.
|
SortingBatch |
loadSortingBatch(Integer sortingBatchId,
CatchBatch parentCatchBatch)
Load a batch.
|
protected void |
refreshSortingBatchInBatchTree(SortingBatch sortingBatch,
CatchBatch parentCatchBatch) |
void |
registerCatchBatchValidator(CatchBatchValidator validator) |
void |
remove(Integer id)
Removes the instance of CatchBatch having the given
identifier from the persistent store. |
void |
removeWithChildren(Integer batchId)
Remove a batch, with all children (could be CatchBatch or a SortingBatch)
-> Method NOT optimize for cache using in loadFullTree : will evict all the cache
|
void |
removeWithChildren(Integer batchId,
CatchBatch parentCatchBatch)
Remove a batch, with all children (could be CatchBatch or a SortingBatch)
-> Method optimize for cache using in loadFullTree()
|
QuantificationMeasurement |
setQuantificationMeasurement(Batch batch,
Integer pmfmId,
Integer recorderDepartmentId,
Float weightValue,
boolean isReferenceQuantitification) |
void |
setSortingBatchReferenceTaxon(String batchId,
Integer referenceTaxonId)
Change the species of a batch.
-> Method NOT optimize for cache using in loadFullTree : will evict all the cache
|
void |
unregisterCatchBatchValidator(CatchBatchValidator validator) |
void |
update(CatchBatch catchBatch)
Updates the
catchBatch instance in the persistent store. |
void |
updateSortingBatch(List<SortingBatch> sortingBatchs,
CatchBatch parentCatchBatch) |
void |
updateSortingBatch(SortingBatch sortingBatch,
CatchBatch parentCatchBatch) |
List<CatchBatchValidationError> |
validate(CatchBatch catchBatch)
Validate a catch batch, using all registered validators that are enable for this catchBatch
|
calculateFirstResult, create, create, create, create, create, create, create, create, get, get, getPaginationResult, getPrincipal, load, load, loadAll, loadAll, loadAll, loadAll, remove, remove, search, search, search, search, toEntities, toEntity, transformEntities, transformEntity, update
convertDatabase2UI, convertUI2DatabaseMandatoryDate, createQuery, dateOfYearWithOneMiliSecond, dateOfYearWithOneMiliSecondInMili, dateWithNoMiliSecond, dateWithNoSecondAndMiliSecond, dateWithNoSecondAndOneMiliSecond, dateWithNoTime, dateWithOneMiliSecond, deleteAll, get, getSession, getSession, getSessionFactory, load, newCreateDate, queryIterator, queryIteratorTyped, queryIteratorWithPage, queryList, queryListTyped, queryUnique, queryUniqueTyped, queryUpdate, setQueryParams, setSessionFactory
protected List<CatchBatchValidator> validators
protected SortingBatchDao sortingBatchDao
protected CatchBatchExtendDao catchBatchDao
@Autowired public CatchBatchDaoImpl(SessionFactory sessionFactory)
public CatchBatch loadFullTree(Integer catchBatchId)
CatchBatchExtendDao
loadFullTree
in interface CatchBatchExtendDao
catchBatchId
- id of the catch batch to loadpublic CatchBatch loadFullTree(Integer catchBatchId, boolean validate, boolean quickFix) throws CatchBatchValidationException
CatchBatchExtendDao
loadFullTree
in interface CatchBatchExtendDao
catchBatchId
- id of the catch batch to loadvalidate
- if true, method validate() is typically calledquickFix
- if true, will try to quick fix validation errorCatchBatchValidationException
- only if valaidate = true, and error found (with gravity ERROR or FATAL)public List<CatchBatchValidationError> validate(CatchBatch catchBatch)
CatchBatchExtendDao
validate
in interface CatchBatchExtendDao
catchBatch
- batch to validatepublic SortingBatch getSortingBatch(Collection<Batch> batchs, Object... params)
CatchBatchExtendDao
getSortingBatch
in interface CatchBatchExtendDao
batchs
- incoming batchs to filterpublic void registerCatchBatchValidator(CatchBatchValidator validator)
registerCatchBatchValidator
in interface CatchBatchExtendDao
public void unregisterCatchBatchValidator(CatchBatchValidator validator)
unregisterCatchBatchValidator
in interface CatchBatchExtendDao
public void update(CatchBatch catchBatch)
CatchBatchDaoBase
catchBatch
instance in the persistent store.update
in interface CatchBatchDao
update
in interface CatchBatchExtendDao
update
in class CatchBatchDaoBase
public void removeWithChildren(Integer batchId)
CatchBatchExtendDao
removeWithChildren
in interface CatchBatchExtendDao
batchId
- id of the batch to removepublic List<Integer> getAllChildrenIds(Integer batchId)
CatchBatchExtendDao
getAllChildrenIds
in interface CatchBatchExtendDao
batchId
- id of the batch to scanpublic void remove(Integer id)
CatchBatchDaoBase
identifier
from the persistent store.remove
in interface CatchBatchDao
remove
in interface CatchBatchExtendDao
remove
in class CatchBatchDaoBase
id
- id of the catch batch to removepublic void removeWithChildren(Integer batchId, CatchBatch parentCatchBatch)
CatchBatchExtendDao
removeWithChildren
in interface CatchBatchExtendDao
batchId
- id of the batch to removepublic CatchBatch loadFullTreeWithCache(Integer catchBatchId, boolean useCache, boolean forceReload)
CatchBatchExtendDao
loadFullTreeWithCache
in interface CatchBatchExtendDao
catchBatchId
- id of the catch batch to loaduseCache
- must the be enable ?forceReload
- is cache is enable, force a eviction to refresh the cachepublic boolean isCatchBatchExistsForFishingOperation(Integer fishingOperationId)
isCatchBatchExistsForFishingOperation
in interface CatchBatchExtendDao
fishingOperationId
- id of the fishing operationtrue
if there is a catchBatch for the given fishing
operation, false
otherwise.public Integer getIdByFishingOperationId(Integer fishingOperationId)
CatchBatchExtendDao
getIdByFishingOperationId
in interface CatchBatchExtendDao
fishingOperationId
- id of the fishing operationpublic Integer getIdBySortingBatchId(Integer batchId)
CatchBatchExtendDao
getIdBySortingBatchId
in interface CatchBatchExtendDao
public SortingBatch getSortingBatchById(CatchBatch catchBatch, Integer sortingBatchId)
CatchBatchExtendDao
getSortingBatchById
in interface CatchBatchExtendDao
sortingBatchId
- id of the sorting batch to retrievepublic QuantificationMeasurement setQuantificationMeasurement(Batch batch, Integer pmfmId, Integer recorderDepartmentId, Float weightValue, boolean isReferenceQuantitification)
setQuantificationMeasurement
in interface CatchBatchExtendDao
public QuantificationMeasurement getQuantificationMeasurement(Batch batch, Integer pmfmId, Integer recorderDepartmentId, boolean createIfNotExists)
getQuantificationMeasurement
in interface CatchBatchExtendDao
public SortingMeasurement getSortingMeasurement(SortingBatch sortingBatch, Integer pmfmId, Integer recorderDepartmentId, boolean createIfNotExists)
getSortingMeasurement
in interface CatchBatchExtendDao
public SortingMeasurement getInheritedSortingMeasurement(SortingBatch sortingBatch, Integer pmfmId)
getInheritedSortingMeasurement
in interface CatchBatchExtendDao
public SortingBatch createSortingBatch(SortingBatch sortingBatch, CatchBatch parentCatchBatch)
CatchBatchExtendDao
createSortingBatch
in interface CatchBatchExtendDao
public SortingBatch loadSortingBatch(Integer sortingBatchId, CatchBatch parentCatchBatch)
CatchBatchExtendDao
loadSortingBatch
in interface CatchBatchExtendDao
public void updateSortingBatch(SortingBatch sortingBatch, CatchBatch parentCatchBatch)
updateSortingBatch
in interface CatchBatchExtendDao
public void updateSortingBatch(List<SortingBatch> sortingBatchs, CatchBatch parentCatchBatch)
updateSortingBatch
in interface CatchBatchExtendDao
protected void applyInheritance(Collection<Batch> batchs, List<SortingMeasurement> inheritedSortingMeasurements, Integer inheritedTaxonGroupId, Integer inheritedReferenceTaxonId, boolean inheritedExhaustiveInventory, int treeLevel)
protected void applyInheritanceOnOneChild(SortingBatch parentBatch, SortingBatch batchToUpdate)
protected void computeTechnicalWeights(Batch batch)
protected Integer getCatchBatchIdByBatchId(String batchId)
protected void refreshSortingBatchInBatchTree(SortingBatch sortingBatch, CatchBatch parentCatchBatch)
public void setSortingBatchReferenceTaxon(String batchId, Integer referenceTaxonId)
CatchBatchExtendDao
setSortingBatchReferenceTaxon
in interface CatchBatchExtendDao
protected void getAllChildrenIds(Integer batchId, List<Integer> result)
Copyright © 2012–2014 IFREMER. All rights reserved.