Session

Session - main interface to load and persist entities -- similar to org.hibernate.Session

Members

Functions

beginTransaction
Transaction beginTransaction()

not supported in current implementation

cancelQuery
void cancelQuery()

not supported in current implementation

clear
void clear()

not supported in current implementation

close
Connection close()

closes session

contains
bool contains(Object object)

Check if this instance is associated with this Session.

createQuery
Query createQuery(string queryString)

Create a new instance of Query for the given HQL query string

get
T get(ID id)

Return the persistent instance of the given named entity with the given identifier, or null if there is no such persistent instance.

getEntityName
string getEntityName(Object object)

Lookup metadata to find entity name for object.

getEntityName
string getEntityName(TypeInfo_Class type)

Lookup metadata to find entity name for class type info.

getMetaData
EntityMetaData getMetaData()

returns metadata

getObject
Object getObject(string entityName, Variant id)

Return the persistent instance of the given named entity with the given identifier, or null if there is no such persistent instance.

getSessionFactory
SessionFactory getSessionFactory()

Retrieve session factory used to create this session

isConnected
bool isConnected()

Check if the session is currently connected.

isDirty
bool isDirty()

Does this session contain any changes which must be synchronized with the database? In other words, would any DML operations be executed if we flushed this session?

isOpen
bool isOpen()

Check if the session is still open.

load
T load(ID id)

Read the persistent state associated with the given identifier into the given transient instance.

load
void load(T obj, ID id)

Read the persistent state associated with the given identifier into the given transient instance.

loadObject
Object loadObject(string entityName, Variant id)

Read the persistent state associated with the given identifier into the given transient instance.

loadObject
void loadObject(Object obj, Variant id)

Read the persistent state associated with the given identifier into the given transient instance

persist
void persist(Object obj)

Persist the given transient instance.

refresh
void refresh(Object obj)

Re-read the state of the given instance from the underlying database.

remove
void remove(Object object)

remove object from DB (renamed from original Session.delete - it's keyword in D)

save
Variant save(Object obj)

Persist the given transient instance, first assigning a generated identifier.

update
void update(Object object)

Update the persistent instance with the identifier of the given detached instance.

Meta