C# Class Castle.Facilities.NHibernateIntegration.Components.Dao.NHibernateGenericDao

Summary description for GenericDao.
Contributed by Steve Degosserie <[email protected]>
Afficher le fichier Open project: hconceicao/Castle.Facilities.NHibernateIntegration3

Méthodes publiques

Méthode Description
Create ( object instance ) : object

Creates (Saves) a new instance to the database.

CreateStateless ( object instance ) : object

Creates (saves or inserts) a new instance to the database using IStatelessSession.

Delete ( object instance ) : void

Deletes the instance from the database.

DeleteAll ( Type type ) : void

Deletes all rows for the specified type

DeleteAllStateless ( Type type ) : void

Deletes all rows for the specified type using IStatelessSession.

DeleteStateless ( object instance ) : void

Deletes the instance from the database using IStatelessSession.

FindAll ( Type type ) : Array

Returns all instances found for the specified type.

FindAll ( Type type, ICriterion criterias ) : Array

Returns all instances found for the specified type using criteria.

FindAll ( Type type, ICriterion criterias, NHibernate.Criterion.Order sortItems ) : Array

Returns all instances found for the specified type using criteria.

FindAll ( Type type, ICriterion criterias, NHibernate.Criterion.Order sortItems, int firstRow, int maxRows ) : Array

Returns all instances found for the specified type using criteria.

FindAll ( Type type, ICriterion criterias, int firstRow, int maxRows ) : Array

Returns all instances found for the specified type using criteria.

FindAll ( Type type, int firstRow, int maxRows ) : Array

Returns a portion of the query results (sliced)

FindAllStateless ( Type type ) : Array

Returns all instances found for the specified type using IStatelessSession.

FindAllStateless ( Type type, ICriterion criterias ) : Array

Returns all instances found for the specified type using criteria and IStatelessSession.

FindAllStateless ( Type type, ICriterion criterias, NHibernate.Criterion.Order sortItems ) : Array

Returns all instances found for the specified type using criteria and IStatelessSession.

FindAllStateless ( Type type, ICriterion criterias, NHibernate.Criterion.Order sortItems, int firstRow, int maxRows ) : Array

Returns all instances found for the specified type using criteria and IStatelessSession.

FindAllStateless ( Type type, ICriterion criterias, int firstRow, int maxRows ) : Array

Returns all instances found for the specified type using criteria and IStatelessSession.

FindAllStateless ( Type type, int firstRow, int maxRows ) : Array

Returns a portion of the query results (sliced) using IStatelessSession.

FindAllWithCustomQuery ( string queryString ) : Array

Finds all with custom query.

FindAllWithCustomQuery ( string queryString, int firstRow, int maxRows ) : Array

Finds all with custom HQL query.

FindAllWithCustomQueryStateless ( string queryString ) : Array

Finds all with custom query using IStatelessSession.

FindAllWithCustomQueryStateless ( string queryString, int firstRow, int maxRows ) : Array

Finds all with custom HQL query using IStatelessSession.

FindAllWithNamedQuery ( string namedQuery ) : Array

Finds all with named HQL query.

FindAllWithNamedQuery ( string namedQuery, int firstRow, int maxRows ) : Array

Finds all with named HQL query.

FindAllWithNamedQueryStateless ( string namedQuery ) : Array

Finds all with named HQL query using IStatelessSession.

FindAllWithNamedQueryStateless ( string namedQuery, int firstRow, int maxRows ) : Array

Finds all with named HQL query using IStatelessSession.

FindById ( Type type, object id ) : object

Finds an object instance by an unique ID

FindByIdStateless ( Type type, object id ) : object

Finds an object instance by an unique ID using IStatelessSession.

NHibernateGenericDao ( ISessionManager sessionManager ) : System

Initializes a new instance of the NHibernateGenericDao class.

NHibernateGenericDao ( ISessionManager sessionManager, string sessionFactoryAlias ) : System

Initializes a new instance of the NHibernateGenericDao class.

Save ( object instance ) : void

Saves the instance to the database. If the primary key is unitialized it creates the instance on the database. Otherwise it updates it.

If the primary key is assigned, then you must invoke Create or Update instead.

Update ( object instance ) : void

Persists the modification on the instance state to the database.

UpdateStateless ( object instance ) : void

Persists the modification on the instance state to the database using IStatelessSession.

Private Methods

Méthode Description
GetSession ( ) : ISession
GetStatelessSession ( ) : IStatelessSession

Method Details

Create() public méthode

Creates (Saves) a new instance to the database.
public Create ( object instance ) : object
instance object The instance to be created on the database
Résultat object

CreateStateless() public méthode

Creates (saves or inserts) a new instance to the database using IStatelessSession.
public CreateStateless ( object instance ) : object
instance object The instance to be created on the database
Résultat object

Delete() public méthode

Deletes the instance from the database.
public Delete ( object instance ) : void
instance object The instance to be deleted from the database
Résultat void

DeleteAll() public méthode

Deletes all rows for the specified type
public DeleteAll ( Type type ) : void
type System.Type type on which the rows on the database should be deleted
Résultat void

DeleteAllStateless() public méthode

Deletes all rows for the specified type using IStatelessSession.
public DeleteAllStateless ( Type type ) : void
type System.Type type on which the rows on the database should be deleted
Résultat void

DeleteStateless() public méthode

Deletes the instance from the database using IStatelessSession.
public DeleteStateless ( object instance ) : void
instance object The instance to be deleted from the database
Résultat void

FindAll() public méthode

Returns all instances found for the specified type.
public FindAll ( Type type ) : Array
type System.Type The target type.
Résultat System.Array

FindAll() public méthode

Returns all instances found for the specified type using criteria.
public FindAll ( Type type, ICriterion criterias ) : Array
type System.Type The target type.
criterias ICriterion The criteria expression
Résultat System.Array

FindAll() public méthode

Returns all instances found for the specified type using criteria.
public FindAll ( Type type, ICriterion criterias, NHibernate.Criterion.Order sortItems ) : Array
type System.Type The target type.
criterias ICriterion The criteria expression
sortItems NHibernate.Criterion.Order An of objects.
Résultat System.Array

FindAll() public méthode

Returns all instances found for the specified type using criteria.
public FindAll ( Type type, ICriterion criterias, NHibernate.Criterion.Order sortItems, int firstRow, int maxRows ) : Array
type System.Type The target type.
criterias ICriterion The criteria expression
sortItems NHibernate.Criterion.Order An of objects.
firstRow int The number of the first row to retrieve.
maxRows int The maximum number of results retrieved.
Résultat System.Array

FindAll() public méthode

Returns all instances found for the specified type using criteria.
public FindAll ( Type type, ICriterion criterias, int firstRow, int maxRows ) : Array
type System.Type The target type.
criterias ICriterion The criteria expression
firstRow int The number of the first row to retrieve.
maxRows int The maximum number of results retrieved.
Résultat System.Array

FindAll() public méthode

Returns a portion of the query results (sliced)
public FindAll ( Type type, int firstRow, int maxRows ) : Array
type System.Type The target type.
firstRow int The number of the first row to retrieve.
maxRows int The maximum number of results retrieved.
Résultat System.Array

FindAllStateless() public méthode

Returns all instances found for the specified type using IStatelessSession.
public FindAllStateless ( Type type ) : Array
type System.Type The target type.
Résultat System.Array

FindAllStateless() public méthode

Returns all instances found for the specified type using criteria and IStatelessSession.
public FindAllStateless ( Type type, ICriterion criterias ) : Array
type System.Type The target type.
criterias ICriterion The criteria expression
Résultat System.Array

FindAllStateless() public méthode

Returns all instances found for the specified type using criteria and IStatelessSession.
public FindAllStateless ( Type type, ICriterion criterias, NHibernate.Criterion.Order sortItems ) : Array
type System.Type The target type.
criterias ICriterion The criteria expression
sortItems NHibernate.Criterion.Order An of objects.
Résultat System.Array

FindAllStateless() public méthode

Returns all instances found for the specified type using criteria and IStatelessSession.
public FindAllStateless ( Type type, ICriterion criterias, NHibernate.Criterion.Order sortItems, int firstRow, int maxRows ) : Array
type System.Type The target type.
criterias ICriterion The criteria expression
sortItems NHibernate.Criterion.Order An of objects.
firstRow int The number of the first row to retrieve.
maxRows int The maximum number of results retrieved.
Résultat System.Array

FindAllStateless() public méthode

Returns all instances found for the specified type using criteria and IStatelessSession.
public FindAllStateless ( Type type, ICriterion criterias, int firstRow, int maxRows ) : Array
type System.Type The target type.
criterias ICriterion The criteria expression
firstRow int The number of the first row to retrieve.
maxRows int The maximum number of results retrieved.
Résultat System.Array

FindAllStateless() public méthode

Returns a portion of the query results (sliced) using IStatelessSession.
public FindAllStateless ( Type type, int firstRow, int maxRows ) : Array
type System.Type The target type.
firstRow int The number of the first row to retrieve.
maxRows int The maximum number of results retrieved.
Résultat System.Array

FindAllWithCustomQuery() public méthode

Finds all with custom query.
public FindAllWithCustomQuery ( string queryString ) : Array
queryString string The query string.
Résultat System.Array

FindAllWithCustomQuery() public méthode

Finds all with custom HQL query.
public FindAllWithCustomQuery ( string queryString, int firstRow, int maxRows ) : Array
queryString string The query string.
firstRow int The number of the first row to retrieve.
maxRows int The maximum number of results retrieved.
Résultat System.Array

FindAllWithCustomQueryStateless() public méthode

Finds all with custom query using IStatelessSession.
public FindAllWithCustomQueryStateless ( string queryString ) : Array
queryString string The query string.
Résultat System.Array

FindAllWithCustomQueryStateless() public méthode

Finds all with custom HQL query using IStatelessSession.
public FindAllWithCustomQueryStateless ( string queryString, int firstRow, int maxRows ) : Array
queryString string The query string.
firstRow int The number of the first row to retrieve.
maxRows int The maximum number of results retrieved.
Résultat System.Array

FindAllWithNamedQuery() public méthode

Finds all with named HQL query.
public FindAllWithNamedQuery ( string namedQuery ) : Array
namedQuery string The named query.
Résultat System.Array

FindAllWithNamedQuery() public méthode

Finds all with named HQL query.
public FindAllWithNamedQuery ( string namedQuery, int firstRow, int maxRows ) : Array
namedQuery string The named query.
firstRow int The number of the first row to retrieve.
maxRows int The maximum number of results retrieved.
Résultat System.Array

FindAllWithNamedQueryStateless() public méthode

Finds all with named HQL query using IStatelessSession.
public FindAllWithNamedQueryStateless ( string namedQuery ) : Array
namedQuery string The named query.
Résultat System.Array

FindAllWithNamedQueryStateless() public méthode

Finds all with named HQL query using IStatelessSession.
public FindAllWithNamedQueryStateless ( string namedQuery, int firstRow, int maxRows ) : Array
namedQuery string The named query.
firstRow int The number of the first row to retrieve.
maxRows int The maximum number of results retrieved.
Résultat System.Array

FindById() public méthode

Finds an object instance by an unique ID
public FindById ( Type type, object id ) : object
type System.Type The AR subclass type
id object ID value
Résultat object

FindByIdStateless() public méthode

Finds an object instance by an unique ID using IStatelessSession.
public FindByIdStateless ( Type type, object id ) : object
type System.Type The AR subclass type
id object ID value
Résultat object

NHibernateGenericDao() public méthode

Initializes a new instance of the NHibernateGenericDao class.
public NHibernateGenericDao ( ISessionManager sessionManager ) : System
sessionManager ISessionManager The session manager.
Résultat System

NHibernateGenericDao() public méthode

Initializes a new instance of the NHibernateGenericDao class.
public NHibernateGenericDao ( ISessionManager sessionManager, string sessionFactoryAlias ) : System
sessionManager ISessionManager The session manager.
sessionFactoryAlias string The session factory alias.
Résultat System

Save() public méthode

Saves the instance to the database. If the primary key is unitialized it creates the instance on the database. Otherwise it updates it.

If the primary key is assigned, then you must invoke Create or Update instead.

public Save ( object instance ) : void
instance object The instance to be saved
Résultat void

Update() public méthode

Persists the modification on the instance state to the database.
public Update ( object instance ) : void
instance object The instance to be updated on the database
Résultat void

UpdateStateless() public méthode

Persists the modification on the instance state to the database using IStatelessSession.
public UpdateStateless ( object instance ) : void
instance object The instance to be updated on the database
Résultat void