Package railo.runtime

Examples of railo.runtime.Component


  /**
   * {@inheritDoc}
   */
  public String resolveEntityName(Object entity) {
    try {
      Component cfc = HibernateCaster.toComponent(entity);
      return HibernateCaster.getEntityName(cfc);
    } catch (PageException pe) {
      //print.printST(e);
      throw new HibernatePageException(pe);
    }
View Full Code Here


  }

  private Serializable toIdentifier(Serializable id) {
    if(id instanceof Component) {
      HashMap<String, String> map = new HashMap<String, String>();
      Component cfc=(Component) id;
      ComponentScope scope = cfc.getComponentScope();
      railo.runtime.component.Property[] props = HibernateUtil.getIDProperties(cfc, true,true);
      String name,value;
      for(int i=0;i<props.length;i++){
        name=props[i].getName();
        value=CommonUtil.toString(scope.get(CommonUtil.createKey(name),null),null);
View Full Code Here

  public final Object instantiate() {
    try {
      PageContext pc = CommonUtil.pc();
      HibernateORMSession session=HibernateUtil.getORMSession(pc,true);
      HibernateORMEngine engine=(HibernateORMEngine) session.getEngine();
      Component c = engine.create(pc, session, entityName, true);
      CommonUtil.setEntity(c,true);
      return c;//new CFCProxy(c);
    }
    catch (PageException pe) {
      throw new HibernatePageException(pe);
View Full Code Here

    }
  }

  @Override
  public final boolean isInstance(Object object) {
    Component cfc = CommonUtil.toComponent(object,null);
    if(cfc==null) return false;
    return isInstanceEntityNames.contains( HibernateCaster.getEntityName(cfc));
  }
View Full Code Here

  private boolean on(Object entity, Serializable id,
      Object[] state, Struct data,
      String[] propertyNames, Type[] types, Collection.Key eventType, boolean hasMethod) {
   
    Component cfc = CommonUtil.toComponent(entity,null);
    if(cfc!=null && EventListener.hasEventType(cfc, eventType)){
      EventListener.invoke(eventType, cfc, data, null);
    }
    if(hasMethod)
      EventListener.invoke(eventType, listener.getCFC(), data, entity);
View Full Code Here

      invoke(name, obj,null);
    }
    protected void invoke(Collection.Key name, Object obj, Struct data) {
      if(eventType!=null && !eventType.equals(name)) return;
      //print.e(name);
      Component caller = CommonUtil.toComponent(obj,null);
      Component c=allEvents?component:caller;
      if(c==null) return;
     
      if(!allEvents &&!caller.getPageSource().equals(component.getPageSource())) return;
    invoke(name, c, data, allEvents?obj:null);
     
View Full Code Here

    }
    return names;
  }

  public Component getEntityByEntityName(String entityName,boolean unique) throws PageException {
    Component cfc;
   
    CFCInfo info = cfcs!=null? cfcs.get(entityName.toLowerCase()):null;
    if(info!=null) {
      cfc=info.getCFC();
      return unique?(Component)Duplicator.duplicate(cfc,false):cfc;
View Full Code Here

    else
      cfcName=null;
   
   
   
    Component cfc;
    String[] names=null;
    // search array (array exist when cfcs is in generation)
   
    List<Component> list = tmpList;
    if(list!=null){
      names=new String[list.size()];
      int index=0;
      Iterator<Component> it2 = list.iterator();
      while(it2.hasNext()){
        cfc=it2.next();
        names[index++]=cfc.getName();
        if(HibernateUtil.isEntity(ormConf,cfc,cfcName,name)) //if(cfc.equalTo(name))
          return unique?(Component)Duplicator.duplicate(cfc,false):cfc;
      }
    }
    else {
View Full Code Here

    if(done.contains(key)) return;
    CFCInfo v;
    String ext = value.getCFC().getExtends();
    if(!Util.isEmpty(ext)){
      try {
        Component base = data.getEntityByCFCName(ext, false);
        ext=HibernateCaster.getEntityName(base);
      } catch (Throwable t) {}
     
     
      ext=HibernateUtil.id(CommonUtil.last(ext, '.').trim());
View Full Code Here

  private final boolean hasPreUpdate;

  public InterceptorImpl(AllEventListener listener) {
    this.listener=listener;
    if(listener!=null) {
      Component cfc = listener.getCFC();
      hasPreInsert=EventListener.hasEventType(cfc, CommonUtil.PRE_INSERT);
      hasPreUpdate=EventListener.hasEventType(cfc, CommonUtil.PRE_UPDATE);
    }
    else {
      hasPreInsert=false;
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.