Package railo.runtime

Examples of railo.runtime.Component


            }
            finally {
              CommonUtil.releaseDatasourceConnection(pc, dc);
            }
            if(data.tmpList.size()!=data.cfcs.size()){
              Component cfc;
              String name,lcName;
              Map<String,String> names=new HashMap<String,String>();
              Iterator<Component> it = data.tmpList.iterator();
              while(it.hasNext()){
                cfc=it.next();
                name=HibernateCaster.getEntityName(cfc);
                lcName=name.toLowerCase();
                if(names.containsKey(lcName))
                  throw ExceptionUtil.createException(data,null,"Entity Name ["+name+"] is ambigous, ["+names.get(lcName)+"] and ["+cfc.getPageSource().getDisplayPath()+"] use the same entity name.","");
                names.put(lcName,cfc.getPageSource().getDisplayPath());
             
            }
          }
        }
      }
View Full Code Here


    if(!data.getORMConfiguration().eventHandling()) return;
    String eventHandler = data.getORMConfiguration().eventHandler();
    AllEventListener listener=null;
    if(!Util.isEmpty(eventHandler,true)){
      //try {
        Component c = pc.loadComponent(eventHandler.trim());
       
        listener = new AllEventListener(c);
            //config.setInterceptor(listener);
      //}catch (PageException e) {e.printStackTrace();}
    }
View Full Code Here

    List<EventListener> list=new ArrayList<EventListener>();
     
   
    Iterator<Entry<String, CFCInfo>> it = cfcs.entrySet().iterator();
    Entry<String, CFCInfo> entry;
    Component cfc;
    while(it.hasNext()){
      entry = it.next();
      cfc = entry.getValue().getCFC();
      if(EventListener.hasEventType(cfc,eventType)) {
        if(CommonUtil.POST_DELETE.equals(eventType))
View Full Code Here

   * @throws PageException
   */
  public Component create(PageContext pc, HibernateORMSession session,String entityName, boolean unique) throws PageException {
    SessionFactoryData data = session.getSessionFactoryData();
    // get existing entity
    Component cfc = _create(pc,entityName,unique,data);
    if(cfc!=null)return cfc;
   
    // reinit ORMEngine
    SessionFactory _old= getSessionFactory(pc,INIT_NOTHING);//_factory;
    SessionFactory _new = getSessionFactory(pc,INIT_CFCS);
View Full Code Here

  }

  private static Component _create(PageContext pc, String entityName, boolean unique, SessionFactoryData data) throws PageException {
    CFCInfo info = data.cfcs.get(HibernateUtil.id(entityName));
    if(info!=null) {
      Component cfc = info.getCFC();
      if(unique){
        cfc=(Component)Duplicator.duplicate(cfc,false);
        if(cfc.contains(pc,CommonUtil.INIT))cfc.call(pc, "init",new Object[]{});
      }
      return cfc;
    }
    return null;
  }
View Full Code Here

  public Object get(Object trg) throws HibernateException {
    try {
      // MUST cache this, perhaps when building xml
      HibernateORMEngine engine = getHibernateORMEngine();
      PageContext pc = CommonUtil.pc();
      Component cfc = CommonUtil.toComponent(trg);
      String name = HibernateCaster.getEntityName(cfc);
      ClassMetadata metaData = engine.getSessionFactory(pc).getClassMetadata(name);
      Type type = HibernateUtil.getPropertyType(metaData, key.getString());

      Object rtn = cfc.getComponentScope().get(key,null);
      return HibernateCaster.toSQL(type, rtn,null);
    }
    catch (PageException pe) {
      throw new HibernatePageException(pe);
    }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public void set(Object trg, Object value, SessionFactoryImplementor factory) throws HibernateException {
    try {
      Component cfc = CommonUtil.toComponent(trg);
      cfc.getComponentScope().set(key,value);
    }
    catch (PageException pe) {
      throw new HibernatePageException(pe);
    }
  }
View Full Code Here

      // MZ: Reinitiate the property collection
      propColl = splitJoins(cfc,joins, _props,data);

      String ext = CommonUtil.last(extend,'.').trim();
      try {
        Component base = data.getEntityByCFCName(ext, false);
        ext = HibernateCaster.getEntityName(base);
      }
      catch(Throwable t){}
     
     
View Full Code Here

    if(value!=null) return value;
   
    if("foreign".equalsIgnoreCase(generator)) {
      if(!Util.isEmpty(foreignCFC.toString())) {
        try {
          Component cfc = data.getEntityByCFCName(foreignCFC.toString(), false);
          if(cfc!=null){
            Property[] ids = getIds(cfc,cfc.getProperties(true),null,true,data);
            if(ids!=null && ids.length>0){
              Property id = ids[0];
              id.getDynamicAttributes();
              Struct meta = id.getDynamicAttributes();
              if(meta!=null){
View Full Code Here

 
 
  private static Component loadForeignCFC(PageContext pc,Component cfc,Property prop, Struct meta, SessionFactoryData data) throws PageException {
    // entity
    String str=toString(cfc,prop,meta,"entityName",data);
    Component fcfc=null;
   
    if(!Util.isEmpty(str,true)) {
      fcfc = data.getEntityByEntityName(str, false);
      if(fcfc!=null) return fcfc;
    }
View Full Code Here

TOP

Related Classes of railo.runtime.Component

Copyright © 2018 www.massapicom. 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.