de.iai.ilcd.model.dao
Class ProcessDao

java.lang.Object
  extended by de.iai.ilcd.model.dao.DataSetDao<Process,de.fzk.iai.ilcd.service.model.IProcessListVO,de.fzk.iai.ilcd.service.model.IProcessVO>
      extended by de.iai.ilcd.model.dao.ProcessDao

public class ProcessDao
extends DataSetDao<Process,de.fzk.iai.ilcd.service.model.IProcessListVO,de.fzk.iai.ilcd.service.model.IProcessVO>

Data access object for processes


Constructor Summary
ProcessDao()
           
 
Method Summary
protected  javax.persistence.Query createQueryObject(org.apache.velocity.tools.generic.ValueParser searchParams, java.lang.String sortString, boolean ascending, boolean returnCount, boolean mostRecentVersionOnly)
          This method must be implemented by each dao class extending this class.
 java.util.List<GeographicalArea> getAllLocations()
           
 de.fzk.iai.ilcd.service.model.IProcessVO getForeignProcess(java.lang.String nodeShortName, java.lang.String uuid)
           
 Process getFullProcess(java.lang.String uuid)
           
 long getNumberOfProcesses(java.lang.String mainClass)
          Deprecated. still exists for internal backwards compatibility, may be removed in future releases. Use DataSetDao.getByClass(String).
 long getNumberOfProcesses(java.lang.String mainClass, java.lang.String subClass)
          Deprecated. still exists for internal backwards compatibility, may be removed in future releases. Use DataSetDao.getByClass(String,String).
 Process getProcess(long datasetId)
          Deprecated. still exists for internal backwards compatibility, may be removed in future releases. Use DataSetDao.getByDataSetId(long).
 Process getProcess(java.lang.String uuid)
          Deprecated. still exists for internal backwards compatibility, may be removed in future releases. Use DataSetDao.getByUuid(String).
 Process getProcess(java.lang.String uuid, DataSetVersion version)
          Deprecated. still exists for internal backwards compatibility, may be removed in future releases. Use DataSetDao.getByUuidAndVersion(String, DataSetVersion).
 Process getProcessById(java.lang.Long id)
          Deprecated. still exists for internal backwards compatibility, may be removed in future releases. Use DataSetDao.getByDataSetId(long).
 Process getProcessById(java.lang.String id)
          Deprecated. still exists for internal backwards compatibility, may be removed in future releases. Use DataSetDao.getByDataSetId(String).
 java.util.List<Process> getProcesses()
          Deprecated. still exists for internal backwards compatibility, may be removed in future releases. Use DataSetDao.getAll().
 java.util.List<Process> getProcessesByClass(java.lang.String mainClass)
          Deprecated. still exists for internal backwards compatibility, may be removed in future releases. Use DataSetDao.getByClass(String).
 java.util.List<Process> getProcessesByClass(java.lang.String mainClass, java.lang.String subClass)
          Deprecated. still exists for internal backwards compatibility, may be removed in future releases. Use DataSetDao.getByClass(String,String).
 java.util.List<Process> getProcessesForExchangeFlow(java.lang.String flowUuid, ExchangeDirection direction, int firstResult, int maxResults)
          Get the list of processes which have the provided direction and flow as in- or output exchange flow
 long getProcessesForExchangeFlowCount(java.lang.String flowUuid, ExchangeDirection direction)
          Get count of processes for provided exchange flow and direction
 java.util.List<java.lang.Integer> getReferenceYears()
           
 java.util.List<GeographicalArea> getUsedLocations()
           
protected  void preCheckAndPersist(Process dataSet)
          Invoked at beginning of DataSetDao.checkAndPersist(DataSet, PersistType, PrintWriter) to manipulate data prior to persisting
 
Methods inherited from class de.iai.ilcd.model.dao.DataSetDao
buildClassificationJoin, buildClassificationJoin, buildClassificationWhere, buildClassificationWhere, checkAndPersist, getAccessedClass, getAll, getAllCount, getByClass, getByClass, getByDataSetId, getByDataSetId, getByUuid, getByUuidAndVersion, getDataSets, getForeignDataSet, getJpaName, getNumberByClass, getNumberByClass, getOtherVersions, getSubClasses, getTopClasses, lsearch, lsearch, lsearch, merge, remove, search, search, search, search, search, searchResultCount
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProcessDao

public ProcessDao()
Method Detail

getFullProcess

public Process getFullProcess(java.lang.String uuid)

preCheckAndPersist

protected void preCheckAndPersist(Process dataSet)
Description copied from class: DataSetDao
Invoked at beginning of DataSetDao.checkAndPersist(DataSet, PersistType, PrintWriter) to manipulate data prior to persisting

Specified by:
preCheckAndPersist in class DataSetDao<Process,de.fzk.iai.ilcd.service.model.IProcessListVO,de.fzk.iai.ilcd.service.model.IProcessVO>
Parameters:
dataSet - data set to manipulate
See Also:
DataSetDao.checkAndPersist(DataSet, PersistType, PrintWriter)

getProcessesForExchangeFlow

public java.util.List<Process> getProcessesForExchangeFlow(java.lang.String flowUuid,
                                                           ExchangeDirection direction,
                                                           int firstResult,
                                                           int maxResults)
Get the list of processes which have the provided direction and flow as in- or output exchange flow

Parameters:
flowUuid - uuid of flow
direction - direction of flow
firstResult - start index
maxResults - maximum result items
Returns:
list of processes which have the provided direction and flow as in- or output exchange flow

getProcessesForExchangeFlowCount

public long getProcessesForExchangeFlowCount(java.lang.String flowUuid,
                                             ExchangeDirection direction)
Get count of processes for provided exchange flow and direction

Parameters:
flowUuid - uuid of flow
direction - direction of flow
Returns:
count of processes for provided exchange flow and direction

getUsedLocations

public java.util.List<GeographicalArea> getUsedLocations()

getAllLocations

public java.util.List<GeographicalArea> getAllLocations()

getReferenceYears

public java.util.List<java.lang.Integer> getReferenceYears()

createQueryObject

protected javax.persistence.Query createQueryObject(org.apache.velocity.tools.generic.ValueParser searchParams,
                                                    java.lang.String sortString,
                                                    boolean ascending,
                                                    boolean returnCount,
                                                    boolean mostRecentVersionOnly)
This method must be implemented by each dao class extending this class. It will return the specific Query object to use for the given subclass of objects, i.e. Process, Flow, ... This method will then be used by the other generic lsearch functions to issue the special query.

Specified by:
createQueryObject in class DataSetDao<Process,de.fzk.iai.ilcd.service.model.IProcessListVO,de.fzk.iai.ilcd.service.model.IProcessVO>
Parameters:
searchParams - lsearch parameter
sortString - field of result object which will be used for ordering of lsearch results
ascending - true for ascending ordering, false for descending
returnCount - if true return count of lsearch result instead of lsearch results
mostRecentVersionOnly - flag to indicate if only the most recent version of a data set shall be returned if multiple versions exist
Returns:
JPA Query objects for doing the lsearch

getForeignProcess

public de.fzk.iai.ilcd.service.model.IProcessVO getForeignProcess(java.lang.String nodeShortName,
                                                                  java.lang.String uuid)

getProcesses

@Deprecated
public java.util.List<Process> getProcesses()
Deprecated. still exists for internal backwards compatibility, may be removed in future releases. Use DataSetDao.getAll().

Get list of all processes

Returns:
list of all processes
See Also:
DataSetDao.getAll()

getProcess

@Deprecated
public Process getProcess(java.lang.String uuid)
Deprecated. still exists for internal backwards compatibility, may be removed in future releases. Use DataSetDao.getByUuid(String).

Get a process by UUID

Parameters:
uuid - UUID of flow to get
Returns:
process with provided UUID
See Also:
DataSetDao.getByUuid(String)

getProcess

@Deprecated
public Process getProcess(java.lang.String uuid,
                                     DataSetVersion version)
Deprecated. still exists for internal backwards compatibility, may be removed in future releases. Use DataSetDao.getByUuidAndVersion(String, DataSetVersion).

Get Process by UUID string and version

Parameters:
uuid - the UUID string
version - the version of the method
Returns:
Process for the specified UUID string/version, or null if none found

getProcess

@Deprecated
public Process getProcess(long datasetId)
Deprecated. still exists for internal backwards compatibility, may be removed in future releases. Use DataSetDao.getByDataSetId(long).

Get the process with the provided JPA id

Parameters:
datasetId - JPA id
Returns:
process with the provided JPA id
See Also:
DataSetDao.getByDataSetId(long)

getProcessById

@Deprecated
public Process getProcessById(java.lang.String id)
Deprecated. still exists for internal backwards compatibility, may be removed in future releases. Use DataSetDao.getByDataSetId(String).

Get the process with the provided JPA id

Parameters:
id - JPA id as string
Returns:
process with the provided JPA id
See Also:
DataSetDao.getByDataSetId(String)

getProcessById

@Deprecated
public Process getProcessById(java.lang.Long id)
Deprecated. still exists for internal backwards compatibility, may be removed in future releases. Use DataSetDao.getByDataSetId(long).

Get the process with the provided JPA id

Parameters:
id - JPA id
Returns:
process with the provided JPA id
See Also:
DataSetDao.getByDataSetId(long)

getProcessesByClass

@Deprecated
public java.util.List<Process> getProcessesByClass(java.lang.String mainClass)
Deprecated. still exists for internal backwards compatibility, may be removed in future releases. Use DataSetDao.getByClass(String).

Get processes by main class

Parameters:
mainClass - main class to get process by
Returns:
matched data sets
See Also:
DataSetDao.getByClass(String)

getNumberOfProcesses

@Deprecated
public long getNumberOfProcesses(java.lang.String mainClass)
Deprecated. still exists for internal backwards compatibility, may be removed in future releases. Use DataSetDao.getByClass(String).

Get the number of processes by main class

Parameters:
mainClass - main class to get process by
Returns:
the number of matched data sets
See Also:
DataSetDao.getNumberByClass(String)

getProcessesByClass

@Deprecated
public java.util.List<Process> getProcessesByClass(java.lang.String mainClass,
                                                              java.lang.String subClass)
Deprecated. still exists for internal backwards compatibility, may be removed in future releases. Use DataSetDao.getByClass(String,String).

Get processes by main and sub class

Parameters:
mainClass - main class to get process by
subClass - sub class to get process by
Returns:
matched data sets
See Also:
DataSetDao.getByClass(String,String)

getNumberOfProcesses

@Deprecated
public long getNumberOfProcesses(java.lang.String mainClass,
                                            java.lang.String subClass)
Deprecated. still exists for internal backwards compatibility, may be removed in future releases. Use DataSetDao.getByClass(String,String).

Get number of processes by main and sub class

Parameters:
mainClass - main class to get process by
subClass - sub class to get process by
Returns:
number of matched data sets
See Also:
DataSetDao.getNumberByClass(String,String)