de.iai.ilcd.model.dao
Class SourceDao

java.lang.Object
  extended by de.iai.ilcd.model.dao.DataSetDao<Source,de.fzk.iai.ilcd.service.model.ISourceListVO>
      extended by de.iai.ilcd.model.dao.SourceDao

public class SourceDao
extends DataSetDao<Source,de.fzk.iai.ilcd.service.model.ISourceListVO>

Data access object for sources


Constructor Summary
SourceDao()
           
 
Method Summary
 boolean checkAndPersist(Source dataSet, PersistType pType, java.io.PrintWriter out)
          Concrete implementation required for saving of digital files
protected  javax.persistence.Query createQueryObject(org.apache.velocity.tools.generic.ValueParser params, java.lang.String sortString, boolean ascending, boolean returnCount)
          This method must be implemented by each dao class extending this class.
 long getNumberOfSources(java.lang.String mainClass)
          Deprecated. still exists for internal backwards compatibility, may be removed in future releases. Use DataSetDao.getByClass(String).
 long getNumberOfSources(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).
 Source getSource(long datasetId)
          Deprecated. still exists for internal backwards compatibility, may be removed in future releases. Use DataSetDao.getByDataSetId(long).
 Source getSource(java.lang.String uuid)
          Deprecated. still exists for internal backwards compatibility, may be removed in future releases. Use DataSetDao.getByUuid(String).
 Source getSourceById(java.lang.Long id)
          Deprecated. still exists for internal backwards compatibility, may be removed in future releases. Use DataSetDao.getByDataSetId(long).
 Source getSourceById(java.lang.String id)
          Deprecated. still exists for internal backwards compatibility, may be removed in future releases. Use DataSetDao.getByDataSetId(String).
 java.util.List<Source> getSources()
          Deprecated. still exists for internal backwards compatibility, may be removed in future releases. Use DataSetDao.getAll().
 java.util.List<Source> getSourcesByClass(java.lang.String mainClass)
          Deprecated. still exists for internal backwards compatibility, may be removed in future releases. Use DataSetDao.getByClass(String).
 java.util.List<Source> getSourcesByClass(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).
protected  void preCheckAndPersist(Source dataSet)
          Invoked at beginning of DataSetDao.checkAndPersist(DataSet, PersistType, PrintWriter) to manipulate data prior to persisting
 void remove(DataSet dataSet)
          Remove a given data set from the database
 
Methods inherited from class de.iai.ilcd.model.dao.DataSetDao
buildClassificationJoin, buildClassificationJoin, buildClassificationWhere, buildClassificationWhere, getAccessedClass, getAll, getAllCount, getByClass, getByClass, getByDataSetId, getByDataSetId, getByUuid, getByUuidAndVersion, getDataSets, getJpaName, getNumberByClass, getNumberByClass, getSubClasses, getTopClasses, lsearch, lsearch, lsearch, merge, 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

SourceDao

public SourceDao()
Method Detail

preCheckAndPersist

protected void preCheckAndPersist(Source 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<Source,de.fzk.iai.ilcd.service.model.ISourceListVO>
Parameters:
dataSet - data set to manipulate
See Also:
DataSetDao.checkAndPersist(DataSet, PersistType, PrintWriter)

checkAndPersist

public boolean checkAndPersist(Source dataSet,
                               PersistType pType,
                               java.io.PrintWriter out)
Concrete implementation required for saving of digital files

Overrides:
checkAndPersist in class DataSetDao<Source,de.fzk.iai.ilcd.service.model.ISourceListVO>
Parameters:
dataSet - data set to persist
pType - which type of persistence operation, new, update (i.e. overwrite existing data set), ...
out - PrintWriter to log error messages which can be presented to the end user
Returns:
true if persist is successful, false otherwise
See Also:
DataSetDao.preCheckAndPersist(DataSet)

remove

public void remove(DataSet dataSet)
            throws DeleteDataSetException
Description copied from class: DataSetDao
Remove a given data set from the database

Overrides:
remove in class DataSetDao<Source,de.fzk.iai.ilcd.service.model.ISourceListVO>
Parameters:
dataSet - data set to be removed
Throws:
DeleteDataSetException

createQueryObject

protected javax.persistence.Query createQueryObject(org.apache.velocity.tools.generic.ValueParser params,
                                                    java.lang.String sortString,
                                                    boolean ascending,
                                                    boolean returnCount)
Description copied from class: DataSetDao
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<Source,de.fzk.iai.ilcd.service.model.ISourceListVO>
Parameters:
params - lsearch parameter
sortString - field of result object which will be used for ordering of lsearch results
returnCount - if true return count of lsearch result instead of lsearch results
Returns:
JPA Query objects for doing the lsearch

getSources

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

Get list of all sources

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

getSource

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

Get a source by UUID

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

getSource

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

Get the source with the provided JPA id

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

getSourceById

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

Get the source with the provided JPA id

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

getSourceById

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

Get the source with the provided JPA id

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

getSourcesByClass

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

Get sources by main class

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

getNumberOfSources

@Deprecated
public long getNumberOfSources(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 sources by main class

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

getSourcesByClass

@Deprecated
public java.util.List<Source> getSourcesByClass(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 sources by main and sub class

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

getNumberOfSources

@Deprecated
public long getNumberOfSources(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 sources by main and sub class

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