public abstract class ManagedDataDaoBase extends HibernateDaoSupport implements ManagedDataDao
Base Spring DAO Class: is able to create, update, remove, load, and find
objects of type ManagedData
.
ManagedData
debugEntityLoad, logger
TRANSFORM_NONE
Constructor and Description |
---|
ManagedDataDaoBase() |
Modifier and Type | Method and Description |
---|---|
protected int |
calculateFirstResult(int pageNumber,
int pageSize)
firstResult = (pageNumber - 1) * pageSize
|
Collection<ManagedData> |
create(Collection<ManagedData> entities)
Creates a new instance of ManagedData and adds
from the passed in
entities collection |
Collection<?> |
create(int transform,
Collection<ManagedData> entities)
Does the same thing as
ManagedDataDao.create(ManagedData) with an
additional flag called transform . |
Object |
create(int transform,
ManagedData managedData)
Does the same thing as
ManagedDataDao.create(ManagedData) with an
additional flag called transform . |
Object |
create(int transform,
ManagedDataType managedDataType,
Person managerUser,
Timestamp updateDate)
Does the same thing as
ManagedDataDao.create(Timestamp) with an
additional flag called transform . |
Object |
create(int transform,
Timestamp updateDate)
Does the same thing as
ManagedDataDao.create(Timestamp) with an
additional flag called transform . |
ManagedData |
create(ManagedData managedData)
Creates an instance of ManagedData and adds it to the persistent store.
|
ManagedData |
create(ManagedDataType managedDataType,
Person managerUser,
Timestamp updateDate)
Creates a new
ManagedData
instance from only required properties (attributes
and association ends) and adds it to the persistent store. |
ManagedData |
create(Timestamp updateDate)
Creates a new
ManagedData
instance from all attributes and adds it to
the persistent store. |
ManagedData |
get(Integer id)
Gets an instance of ManagedData from the persistent store.
|
Object |
get(int transform,
Integer id)
Does the same thing as
ManagedDataDao.get(Integer) with an
additional flag called transform . |
protected PaginationResult |
getPaginationResult(Query queryObject,
int transform,
int pageNumber,
int pageSize)
Executes and returns the given Hibernate queryObject as a
PaginationResult instance. |
protected Principal |
getPrincipal()
Gets the current
principal if one has been set,
otherwise returns null . |
ManagedData |
load(Integer id)
Loads an instance of ManagedData from the persistent store.
|
Object |
load(int transform,
Integer id)
Does the same thing as
ManagedDataDao.load(Integer) with an
additional flag called transform . |
Collection<ManagedData> |
loadAll()
Loads all entities of type
ManagedData . |
Collection<?> |
loadAll(int transform)
Does the same thing as
ManagedDataDao.loadAll() with an
additional flag called transform . |
Collection<?> |
loadAll(int pageNumber,
int pageSize)
Does the same thing as
ManagedDataDao.loadAll() with an
additional two arguments called pageNumber and pageSize . |
Collection<?> |
loadAll(int transform,
int pageNumber,
int pageSize)
Does the same thing as
ManagedDataDao.loadAll(int) with an
additional two arguments called pageNumber and pageSize . |
void |
remove(Collection<ManagedData> entities)
Removes all entities in the given
entities collection. |
void |
remove(Integer id)
Removes the instance of ManagedData having the given
identifier from the persistent store. |
void |
remove(ManagedData managedData)
Removes the instance of ManagedData from the persistent store.
|
PaginationResult |
search(int transform,
int pageNumber,
int pageSize,
Search search)
Does the same thing as
ManagedDataDao.search(int, Search) but with an
additional two flags called pageNumber and pageSize . |
PaginationResult |
search(int pageNumber,
int pageSize,
Search search)
Does the same thing as
ManagedDataDao.search(Search) but with an
additional two flags called pageNumber and pageSize . |
Set<?> |
search(int transform,
Search search)
Does the same thing as
ManagedDataDao.search(Search) but with an
additional flag called transform . |
Set<ManagedData> |
search(Search search)
Performs a search using the parameters specified in the given
search object. |
void |
toEntities(Collection<?> results)
Transforms the given results to a collection of
ManagedData
instances (this is useful when the returned results contains a row of data and you want just entities only). |
protected ManagedData |
toEntity(Object[] row) |
void |
transformEntities(int transform,
Collection<?> entities)
Transforms a collection of entities using the
ManagedDataDao.transformEntity(int,ManagedData)
method. |
Object |
transformEntity(int transform,
ManagedData entity)
Allows transformation of entities into value objects
(or something else for that matter), when the
transform
flag is set to one of the constants defined in ManagedDataDao , please note
that the ManagedDataDao.TRANSFORM_NONE constant denotes no transformation, so the entity itself
will be returned. |
void |
update(Collection<ManagedData> entities)
Updates all instances in the
entities collection in the persistent store. |
void |
update(ManagedData managedData)
Updates the
managedData instance in the persistent store. |
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
public ManagedDataDaoBase()
public Object get(int transform, Integer id)
Does the same thing as ManagedDataDao.get(Integer)
with an
additional flag called transform
. If this flag is set to TRANSFORM_NONE
then
the returned entity will NOT be transformed. If this flag is any of the other constants
defined in this class then the result WILL BE passed through an operation which can
optionally transform the entity (into a value object for example). By default, transformation does
not occur.
get
in interface ManagedDataDao
transform
- flag to determine transformation type.id
- the identifier of the entity to get.public ManagedData get(Integer id)
get
in interface ManagedDataDao
public Object load(int transform, Integer id)
Does the same thing as ManagedDataDao.load(Integer)
with an
additional flag called transform
. If this flag is set to TRANSFORM_NONE
then
the returned entity will NOT be transformed. If this flag is any of the other constants
defined in this class then the result WILL BE passed through an operation which can
optionally transform the entity (into a value object for example). By default, transformation does
not occur.
load
in interface ManagedDataDao
transform
- flag to determine transformation type.id
- the identifier of the entity to load.public ManagedData load(Integer id)
load
in interface ManagedDataDao
public Collection<ManagedData> loadAll()
ManagedData
.loadAll
in interface ManagedDataDao
public Collection<?> loadAll(int transform)
Does the same thing as ManagedDataDao.loadAll()
with an
additional flag called transform
. If this flag is set to TRANSFORM_NONE
then
the returned entity will NOT be transformed. If this flag is any of the other constants
defined here then the result WILL BE passed through an operation which can optionally
transform the entity (into a value object for example). By default, transformation does
not occur.
loadAll
in interface ManagedDataDao
transform
- the flag indicating what transformation to use.public Collection<?> loadAll(int pageNumber, int pageSize)
Does the same thing as ManagedDataDao.loadAll()
with an
additional two arguments called pageNumber
and pageSize
. The pageNumber
argument allows you to specify the page number when you are paging the results and the pageSize allows you to specify the size of the
page retrieved.
loadAll
in interface ManagedDataDao
pageNumber
- the page number to retrieve when paging results.pageSize
- the size of the page to retrieve when paging results.public Collection<?> loadAll(int transform, int pageNumber, int pageSize)
Does the same thing as ManagedDataDao.loadAll(int)
with an
additional two arguments called pageNumber
and pageSize
. The pageNumber
argument allows you to specify the page number when you are paging the results and the pageSize allows you to specify the size of the
page retrieved.
loadAll
in interface ManagedDataDao
transform
- the flag indicating what transformation to use.pageNumber
- the page number to retrieve when paging results.pageSize
- the size of the page to retrieve when paging results.protected int calculateFirstResult(int pageNumber, int pageSize)
pageNumber
- pageSize
- public ManagedData create(ManagedData managedData)
create
in interface ManagedDataDao
public Object create(int transform, ManagedData managedData)
Does the same thing as ManagedDataDao.create(ManagedData)
with an
additional flag called transform
. If this flag is set to TRANSFORM_NONE
then
the returned entity will NOT be transformed. If this flag is any of the other constants
defined here then the result WILL BE passed through an operation which can optionally
transform the entity (into a value object for example). By default, transformation does
not occur.
create
in interface ManagedDataDao
public Collection<ManagedData> create(Collection<ManagedData> entities)
entities
collectioncreate
in interface ManagedDataDao
entities
- the collection of ManagedData
instances to create.public Collection<?> create(int transform, Collection<ManagedData> entities)
Does the same thing as ManagedDataDao.create(ManagedData)
with an
additional flag called transform
. If this flag is set to TRANSFORM_NONE
then
the returned entity will NOT be transformed. If this flag is any of the other constants
defined here then the result WILL BE passed through an operation which can optionally
transform the entities (into value objects for example). By default, transformation does
not occur.
create
in interface ManagedDataDao
public ManagedData create(Timestamp updateDate)
Creates a new ManagedData
instance from all attributes and adds it to
the persistent store.
create
in interface ManagedDataDao
public Object create(int transform, Timestamp updateDate)
Does the same thing as ManagedDataDao.create(Timestamp)
with an
additional flag called transform
. If this flag is set to TRANSFORM_NONE
then
the returned entity will NOT be transformed. If this flag is any of the other constants
defined here then the result WILL BE passed through an operation which can optionally
transform the entity (into a value object for example). By default, transformation does
not occur.
create
in interface ManagedDataDao
public ManagedData create(ManagedDataType managedDataType, Person managerUser, Timestamp updateDate)
Creates a new ManagedData
instance from only required properties (attributes
and association ends) and adds it to the persistent store.
create
in interface ManagedDataDao
public Object create(int transform, ManagedDataType managedDataType, Person managerUser, Timestamp updateDate)
Does the same thing as ManagedDataDao.create(Timestamp)
with an
additional flag called transform
. If this flag is set to TRANSFORM_NONE
then
the returned entity will NOT be transformed. If this flag is any of the other constants
defined here then the result WILL BE passed through an operation which can optionally
transform the entity (into a value object for example). By default, transformation does
not occur.
create
in interface ManagedDataDao
transform
- flag to determine transformation type.public void update(ManagedData managedData)
managedData
instance in the persistent store.update
in interface ManagedDataDao
public void update(Collection<ManagedData> entities)
entities
collection in the persistent store.update
in interface ManagedDataDao
public void remove(ManagedData managedData)
remove
in interface ManagedDataDao
public void remove(Integer id)
identifier
from the persistent store.remove
in interface ManagedDataDao
public void remove(Collection<ManagedData> entities)
entities
collection.remove
in interface ManagedDataDao
public Object transformEntity(int transform, ManagedData entity)
transform
flag is set to one of the constants defined in ManagedDataDao
, please note
that the ManagedDataDao.TRANSFORM_NONE
constant denotes no transformation, so the entity itself
will be returned.
If the integer argument value is unknown ManagedDataDao.TRANSFORM_NONE
is assumed.transformEntity
in interface ManagedDataDao
transform
- one of the constants declared in ManagedDataDao
entity
- an entity that was foundManagedDataDao.transformEntity(int, ManagedData)
public void transformEntities(int transform, Collection<?> entities)
ManagedDataDao.transformEntity(int,ManagedData)
method. This method does not instantiate a new collection.
This method is to be used internally only.
transformEntities
in interface ManagedDataDao
transform
- one of the constants declared in fr.ifremer.adagio.core.dao.administration.user.ManagedDataDao
entities
- the collection of entities to transformManagedDataDao.transformEntity(int,ManagedData)
public void toEntities(Collection<?> results)
ManagedDataDao
ManagedData
instances (this is useful when the returned results contains a row of data and you want just entities only).toEntities
in interface ManagedDataDao
results
- the query results.ManagedDataDao.toEntities(Collection)
protected ManagedData toEntity(Object[] row)
row
- protected Principal getPrincipal()
principal
if one has been set,
otherwise returns null
.public PaginationResult search(int transform, int pageNumber, int pageSize, Search search)
ManagedDataDao.search(int, Search)
but with an
additional two flags called pageNumber
and pageSize
. These flags allow you to
limit your data to a specified page number and size.search
in interface ManagedDataDao
transform
- the transformation flag.pageNumber
- the page number in the data to retrievepageSize
- the size of the page to retrieve.search
- the search object which provides the search parameters and pagination specification.PaginationResult
instance.public PaginationResult search(int pageNumber, int pageSize, Search search)
ManagedDataDao.search(Search)
but with an
additional two flags called pageNumber
and pageSize
. These flags allow you to
limit your data to a specified page number and size.search
in interface ManagedDataDao
pageNumber
- the page number in the data to retrievepageSize
- the size of the page to retrieve.search
- the search object which provides the search parameters and pagination specification.PaginationResult
instance.public Set<?> search(int transform, Search search)
ManagedDataDao.search(Search)
but with an
additional flag called transform
. If this flag is set to TRANSFORM_NONE
then
finder results will NOT be transformed during retrieval.
If this flag is any of the other constants defined here
then results WILL BE passed through an operation which can optionally
transform the entities (into value objects for example). By default, transformation does
not occur.search
in interface ManagedDataDao
transform
- the transformation flag.search
- the search object which provides the search parameters and pagination specification.public Set<ManagedData> search(Search search)
search
object.search
in interface ManagedDataDao
search
- the search object which provides the search parameters and pagination specification.protected PaginationResult getPaginationResult(Query queryObject, int transform, int pageNumber, int pageSize)
PaginationResult
instance.queryObject
- transform
- pageNumber
- pageSize
- Copyright © 2012–2014 IFREMER. All rights reserved.