C# Class NSoft.NFramework.Data.NHibernateEx.Domain.UserTypes.YearAndWeekUserType

Inheritance: ICompositeUserType
ファイルを表示 Open project: debop/NFramework

Public Methods

Method Description
Assemble ( object cached, ISessionImplementor session, object owner ) : object

Reconstruct an object from the cacheable representation. At the very least this method should perform a deep copy. (optional operation)

DeepCopy ( object value ) : object

Return a deep copy of the persistent state, stopping at entities and at collections.

Disassemble ( object value, ISessionImplementor session ) : object

Transform the object into its cacheable representation. At the very least this method should perform a deep copy. That may not be enough for some implementations, method should perform a deep copy. That may not be enough for some implementations, however; for example, associations must be cached as identifier values. (optional operation)

Equals ( object x, object y ) : bool

Compare two instances of the class mapped by this type for persistence "equality", ie. equality of persistent state.

GetHashCode ( object x ) : int
GetPropertyValue ( object component, int property ) : object

Get the value of a property

NullSafeGet ( IDataReader dr, string names, ISessionImplementor session, object owner ) : object

Retrieve an instance of the mapped class from a IDataReader. Implementors should handle possibility of null values.

NullSafeSet ( IDbCommand cmd, object value, int index, ISessionImplementor session ) : void

Write an instance of the mapped class to a prepared statement. Implementors should handle possibility of null values. A multi-column type should be written to parameters starting from index.

NullSafeSet ( IDbCommand cmd, object value, int index, bool settable, ISessionImplementor session ) : void

Write an instance of the mapped class to a prepared statement. Implementors should handle possibility of null values. A multi-column type should be written to parameters starting from index. If a property is not settable, skip it and don't increment the index.

Replace ( object original, object target, ISessionImplementor session, object owner ) : object

During merge, replace the existing (target) value in the entity we are merging to with a new (original) value from the detached entity we are merging. For immutable objects, or null values, it is safe to simply return the first parameter. For mutable objects, it is safe to return a copy of the first parameter. However, since composite user types often define component values, it might make sense to recursively replace component values in the target object.

SetPropertyValue ( object component, int property, object value ) : void

Set the value of a property

Private Methods

Method Description
AsYearAndWeek ( object value ) : YearAndWeek

지정한 객체를 YearAndWeek로 캐스팅합니다.

Method Details

Assemble() public method

Reconstruct an object from the cacheable representation. At the very least this method should perform a deep copy. (optional operation)
public Assemble ( object cached, ISessionImplementor session, object owner ) : object
cached object the object to be cached
session ISessionImplementor
owner object
return object

DeepCopy() public method

Return a deep copy of the persistent state, stopping at entities and at collections.
public DeepCopy ( object value ) : object
value object generally a collection element or entity field
return object

Disassemble() public method

Transform the object into its cacheable representation. At the very least this method should perform a deep copy. That may not be enough for some implementations, method should perform a deep copy. That may not be enough for some implementations, however; for example, associations must be cached as identifier values. (optional operation)
public Disassemble ( object value, ISessionImplementor session ) : object
value object the object to be cached
session ISessionImplementor
return object

Equals() public method

Compare two instances of the class mapped by this type for persistence "equality", ie. equality of persistent state.
public Equals ( object x, object y ) : bool
x object
y object
return bool

GetHashCode() public method

public GetHashCode ( object x ) : int
x object
return int

GetPropertyValue() public method

Get the value of a property
public GetPropertyValue ( object component, int property ) : object
component object an instance of class mapped by this "type"
property int
return object

NullSafeGet() public method

Retrieve an instance of the mapped class from a IDataReader. Implementors should handle possibility of null values.
public NullSafeGet ( IDataReader dr, string names, ISessionImplementor session, object owner ) : object
dr IDataReader IDataReader
names string the column names
session ISessionImplementor the containing entity
owner object
return object

NullSafeSet() public method

Write an instance of the mapped class to a prepared statement. Implementors should handle possibility of null values. A multi-column type should be written to parameters starting from index.
public NullSafeSet ( IDbCommand cmd, object value, int index, ISessionImplementor session ) : void
cmd IDbCommand
value object
index int
session ISessionImplementor
return void

NullSafeSet() public method

Write an instance of the mapped class to a prepared statement. Implementors should handle possibility of null values. A multi-column type should be written to parameters starting from index. If a property is not settable, skip it and don't increment the index.
public NullSafeSet ( IDbCommand cmd, object value, int index, bool settable, ISessionImplementor session ) : void
cmd IDbCommand
value object
index int
settable bool
session ISessionImplementor
return void

Replace() public method

During merge, replace the existing (target) value in the entity we are merging to with a new (original) value from the detached entity we are merging. For immutable objects, or null values, it is safe to simply return the first parameter. For mutable objects, it is safe to return a copy of the first parameter. However, since composite user types often define component values, it might make sense to recursively replace component values in the target object.
public Replace ( object original, object target, ISessionImplementor session, object owner ) : object
original object
target object
session ISessionImplementor
owner object
return object

SetPropertyValue() public method

Set the value of a property
public SetPropertyValue ( object component, int property, object value ) : void
component object an instance of class mapped by this "type"
property int the value to set
value object
return void