Examples of ORMSession


Examples of railo.runtime.orm.ORMSession

    pageContext.undefinedScope().setEL(CFQUERY,sct);
  }


  private Object executeORM(SQL sql, int returnType, Struct ormoptions) throws PageException {
    ORMSession session=ORMUtil.getSession(pageContext);
   
    // params
    SQLItem[] _items = sql.getItems();
    Array params=new ArrayImpl();
    for(int i=0;i<_items.length;i++){
      params.appendEL(_items[i]);
    }
   
    // query options
    if(maxrows!=-1 && !ormoptions.containsKey(MAX_RESULTS)) ormoptions.setEL(MAX_RESULTS, new Double(maxrows));
    if(timeout!=-1 && !ormoptions.containsKey(TIMEOUT)) ormoptions.setEL(TIMEOUT, new Double(timeout));
    /* MUST
offset: Specifies the start index of the resultset from where it has to start the retrieval.
cacheable: Whether the result of this query is to be cached in the secondary cache. Default is false.
cachename: Name of the cache in secondary cache.
     */
    Object res = session.executeQuery(pageContext,sql.getSQLString(),params,unique,ormoptions);
    if(returnType==RETURN_TYPE_ARRAY_OF_ENTITY) return res;
    return session.toQuery(pageContext, res, null);
   
  }
View Full Code Here

Examples of railo.runtime.orm.ORMSession

    return session.toQuery(pageContext, res, null);
   
  }
 
  public static Object _call(PageContext pc,String hql, Object params, boolean unique, Struct queryOptions) throws PageException {
    ORMSession session=ORMUtil.getSession(pc);
    if(Decision.isCastableToArray(params))
      return session.executeQuery(pc,hql,Caster.toArray(params),unique,queryOptions);
    else if(Decision.isCastableToStruct(params))
      return session.executeQuery(pc,hql,Caster.toStruct(params),unique,queryOptions);
    else
      return session.executeQuery(pc,hql,(Array)params,unique,queryOptions);
  }
View Full Code Here

Examples of railo.runtime.orm.ORMSession

  public static Object call(PageContext pc, String name) throws PageException {
    return call(pc, name, null);
  }
 
  public static Object call(PageContext pc, String name,Struct properties) throws PageException {
    ORMSession session=ORMUtil.getSession(pc);
    if(properties==null)return session.create(pc,name);
   
    Component entity = session.create(pc,name);
    setPropeties(pc,entity,properties,false);
    return entity;
   
  }
View Full Code Here

Examples of railo.runtime.orm.ORMSession

import railo.runtime.orm.ORMSession;
import railo.runtime.orm.ORMUtil;

public class EntityDelete {
  public static String call(PageContext pc, Object obj) throws PageException {
    ORMSession session = ORMUtil.getSession(pc);
    session.delete(pc,obj);
    return null;
  }
View Full Code Here

Examples of railo.runtime.orm.ORMSession

  public static String call(PageContext pc, Object obj) throws PageException {
    return call(pc, obj, false);
  }
  public static String call(PageContext pc, Object obj,boolean forceInsert) throws PageException {
    ORMSession session=ORMUtil.getSession(pc);
    session.save(pc,obj,forceInsert);
    return null;
  }
View Full Code Here

Examples of railo.runtime.orm.ORMSession

public class ORMEvictQueries {
  public static String call(PageContext pc) throws PageException {
    return call(pc,null);
  }
  public static String call(PageContext pc,String cacheName) throws PageException {
    ORMSession session=ORMUtil.getSession(pc);
    if(StringUtil.isEmpty(cacheName))session.evictQueries(pc);
    else session.evictQueries(pc, cacheName);
    return null;
  }
View Full Code Here

Examples of railo.runtime.orm.ORMSession

import railo.runtime.type.ArrayImpl;

public class EntityNameArray{
 
  public static Array call(PageContext pc) throws PageException {
    ORMSession sess = ORMUtil.getSession(pc);
    return new ArrayImpl(sess.getEntityNames());
  }
View Full Code Here

Examples of railo.runtime.orm.ORMSession

import railo.runtime.orm.ORMUtil;

public class EntityMerge {

  public static Object call(PageContext pc, Object obj) throws PageException {
    ORMSession session=ORMUtil.getSession(pc);
    return session.merge(pc,obj);
  }
View Full Code Here

Examples of railo.runtime.orm.ORMSession

  public static Query call(PageContext pc, Object obj) throws PageException {
    return call(pc, obj,null);
  }
 
  public static Query call(PageContext pc, Object obj, String name) throws PageException {
    ORMSession session=ORMUtil.getSession(pc);
    return session.toQuery(pc,obj,name);
   
  }
View Full Code Here

Examples of railo.runtime.orm.ORMSession

import railo.runtime.orm.ORMUtil;

public class EntityReload {

  public static String call(PageContext pc, Object obj) throws PageException {
    ORMSession session = ORMUtil.getSession(pc);
    session.reload(pc,obj);
    return null;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.