railo.runtime.orm
Interface ORMSession

All Known Implementing Classes:
HibernateORMSession

public interface ORMSession


Method Summary
 void clear(PageContext pc)
          clear the session
 void close(PageContext pc)
          close the session
 Component create(PageContext pc, String entityName)
          creates a entity matching the given name
 void delete(PageContext pc, Object obj)
          delete elememt from datasource
 void evictCollection(PageContext pc, String entity, String collection)
           
 void evictCollection(PageContext pc, String entity, String collection, String id)
           
 void evictEntity(PageContext pc, String entity)
           
 void evictEntity(PageContext pc, String entity, String id)
           
 void evictQueries(PageContext pc)
           
 void evictQueries(PageContext pc, String cacheName)
           
 Object executeQuery(PageContext pc, String hql, Array params, boolean unique, Struct queryOptions)
           
 Object executeQuery(PageContext pc, String hql, Struct params, boolean unique, Struct queryOptions)
           
 void flush(PageContext pc)
          flush all elements in session
 DatasourceConnection getDatasourceConnection()
           
 ORMEngine getEngine()
          engine from session
 Object getRawSession()
           
 ORMTransaction getTransaction(boolean autoManage)
           
 boolean isValid()
          is session valid or not
 Component load(PageContext pc, String name, String id)
          load and return a Object that match given id, if there is more than one Object matching the id, only the first Object is returned
 Component load(PageContext pc, String name, Struct filter)
          load and return a Object that match given filter, if there is more than one Object matching the filter, only the first Object is returned
 Array loadAsArray(PageContext pc, String name, String id)
          load and return a array of Objects matching given id
 Array loadAsArray(PageContext pc, String name, String id, String order)
           
 Array loadAsArray(PageContext pc, String name, Struct filter)
          load and return a array of Objects matching given filter
 Array loadAsArray(PageContext pc, String name, Struct filter, Struct options)
          load and return a array of Objects matching given filter
 Array loadAsArray(PageContext pc, String name, Struct filter, Struct options, String order)
           
 Component loadByExample(PageContext pc, Object obj)
          load and return a Object that match given sampleEntity, if there is more than one Object matching the id, only the first Object is returned
 Array loadByExampleAsArray(PageContext pc, Object obj)
          load and return a array of Objects matching given sampleEntity
 Component merge(PageContext pc, Object obj)
          Attaches the specified entity to the current ORM session.
 void reload(PageContext pc, Object obj)
          Reloads data for an entity that is already loaded.
 void save(PageContext pc, Object obj, boolean forceInsert)
          insert entity into datasource, even the entry already exist
 Query toQuery(PageContext pc, Object obj, String name)
           
 

Method Detail

flush

void flush(PageContext pc)
           throws PageException
flush all elements in session

Parameters:
pc -
Throws:
PageException

delete

void delete(PageContext pc,
            Object obj)
            throws PageException
delete elememt from datasource

Parameters:
name -
Throws:
PageException

save

void save(PageContext pc,
          Object obj,
          boolean forceInsert)
          throws PageException
insert entity into datasource, even the entry already exist

Parameters:
entity -
Throws:
PageException

reload

void reload(PageContext pc,
            Object obj)
            throws PageException
Reloads data for an entity that is already loaded. This method refetches data from the database and repopulates the entity with the refreshed data.

Parameters:
obj -
Throws:
ORMException
PageException

create

Component create(PageContext pc,
                 String entityName)
                 throws PageException
creates a entity matching the given name

Parameters:
entityName -
Returns:
Throws:
ORMException
PageException

merge

Component merge(PageContext pc,
                Object obj)
                throws PageException
Attaches the specified entity to the current ORM session. It copies the state of the given object onto the persistent object with the same identifier and returns the persistent object. If there is no persistent instance currently associated with the session, it is loaded. The given instance is not associated with the session. User have to use the returned object from this session.

Parameters:
entity -
Returns:
Throws:
PageException

clear

void clear(PageContext pc)
           throws PageException
clear the session

Parameters:
pc -
Throws:
PageException

load

Component load(PageContext pc,
               String name,
               Struct filter)
               throws PageException
load and return a Object that match given filter, if there is more than one Object matching the filter, only the first Object is returned

Parameters:
name -
filter -
Returns:
Throws:
PageException

toQuery

Query toQuery(PageContext pc,
              Object obj,
              String name)
              throws PageException
Throws:
PageException

load

Component load(PageContext pc,
               String name,
               String id)
               throws PageException
load and return a Object that match given id, if there is more than one Object matching the id, only the first Object is returned

Parameters:
name -
id -
Throws:
PageException

loadAsArray

Array loadAsArray(PageContext pc,
                  String name,
                  Struct filter)
                  throws PageException
load and return a array of Objects matching given filter

Parameters:
name -
filter -
Returns:
Throws:
PageException

loadAsArray

Array loadAsArray(PageContext pc,
                  String name,
                  Struct filter,
                  Struct options)
                  throws PageException
load and return a array of Objects matching given filter

Parameters:
name -
filter -
options -
Returns:
Throws:
PageException

loadAsArray

Array loadAsArray(PageContext pc,
                  String name,
                  Struct filter,
                  Struct options,
                  String order)
                  throws PageException
Parameters:
pc -
name -
filter -
options -
order -
Returns:
Throws:
PageException

loadAsArray

Array loadAsArray(PageContext pc,
                  String name,
                  String id)
                  throws PageException
load and return a array of Objects matching given id

Parameters:
name -
id -
Throws:
PageException

loadAsArray

Array loadAsArray(PageContext pc,
                  String name,
                  String id,
                  String order)
                  throws PageException
Parameters:
pc -
name -
id -
order -
Returns:
Throws:
PageException

loadByExampleAsArray

Array loadByExampleAsArray(PageContext pc,
                           Object obj)
                           throws PageException
load and return a array of Objects matching given sampleEntity

Parameters:
name -
id -
Throws:
PageException

loadByExample

Component loadByExample(PageContext pc,
                        Object obj)
                        throws PageException
load and return a Object that match given sampleEntity, if there is more than one Object matching the id, only the first Object is returned

Parameters:
name -
id -
Throws:
PageException

evictCollection

void evictCollection(PageContext pc,
                     String entity,
                     String collection)
                     throws PageException
Throws:
PageException

evictCollection

void evictCollection(PageContext pc,
                     String entity,
                     String collection,
                     String id)
                     throws PageException
Throws:
PageException

evictEntity

void evictEntity(PageContext pc,
                 String entity)
                 throws PageException
Throws:
PageException

evictEntity

void evictEntity(PageContext pc,
                 String entity,
                 String id)
                 throws PageException
Throws:
PageException

evictQueries

void evictQueries(PageContext pc)
                  throws PageException
Throws:
PageException

evictQueries

void evictQueries(PageContext pc,
                  String cacheName)
                  throws PageException
Throws:
PageException

executeQuery

Object executeQuery(PageContext pc,
                    String hql,
                    Array params,
                    boolean unique,
                    Struct queryOptions)
                    throws PageException
Throws:
PageException

executeQuery

Object executeQuery(PageContext pc,
                    String hql,
                    Struct params,
                    boolean unique,
                    Struct queryOptions)
                    throws PageException
Throws:
PageException

close

void close(PageContext pc)
           throws PageException
close the session

Parameters:
pc -
Throws:
PageException

isValid

boolean isValid()
is session valid or not

Returns:
is session valid

getEngine

ORMEngine getEngine()
engine from session

Returns:
engine

getRawSession

Object getRawSession()

getTransaction

ORMTransaction getTransaction(boolean autoManage)

getDatasourceConnection

DatasourceConnection getDatasourceConnection()


Copyright © 2012 Railo