Examples of EntityFactory


Examples of com.caucho.amber.entity.EntityFactory

      EntityItem item = home.findEntityItem(this, key);

      if (item == null)
        return null;

      EntityFactory factory = home.getEntityFactory();

      Object newEntity = factory.getEntity(this, item);

      if (_persistenceUnit.isJPA()) {
        // jpa/0h29: eager loading.
        Entity instance = (Entity) newEntity;
        setTransactionalState(instance);
View Full Code Here

Examples of com.caucho.amber.entity.EntityFactory

    }
    */
   
    AmberEntityHome home = entityItem.getEntityHome();

    EntityFactory factory = home.getEntityFactory();

    Object newEntity = factory.getEntity(this, entityItem);

    return newEntity;
  }
View Full Code Here

Examples of com.caucho.amber.entity.EntityFactory

          log.log(Level.FINER, L.l("Amber.addNewEntity: home not found for entity (class: '{0}' PK: '{1}')",
                                   className, key));
        return null;
      }

      EntityFactory factory = entityHome.getEntityFactory();

      // TestBean__EJB
      Object value = factory.getEntity(key);

      Method cauchoGetBeanMethod = entityHome.getCauchoGetBeanMethod();
      if (cauchoGetBeanMethod != null) {
        try {
          // Bean
View Full Code Here

Examples of com.caucho.amber.entity.EntityFactory

          log.log(Level.FINER, L.l("Amber.addNewEntity: home not found for entity (class: '{0}' PK: '{1}')",
                                   className, key));
        return null;
      }

      EntityFactory factory = entityHome.getEntityFactory();

      // TestBean__EJB
      Object value = factory.getEntity(key);

      Method cauchoGetBeanMethod = entityHome.getCauchoGetBeanMethod();
      if (cauchoGetBeanMethod != null) {
        try {
          // Bean
View Full Code Here

Examples of com.dtrules.session.EntityFactory

            }catch(NullPointerException e){
                throw new RulesException("undefined", "PerformCatchError",
                        "The table '"+table.stringValue()+"' is undefined");
            }catch(RulesException e){
                IRSession     session       = state.getSession();
                EntityFactory ef            = session.getEntityFactory();  
                IREntity      errorEntity   = ef.findRefEntity(error).clone(session).rEntityValue();
                state.entitypush(errorEntity);
               
                // If any of the following puts fail (because the given entity doesn't define them), then
                // simply carry on your merry way.  The user can define these fields if they need them,
                // and they don't need to define them if they don't need them.
View Full Code Here

Examples of com.dtrules.session.EntityFactory

     * @param rulesetname The Rule Set to be written out to the output stream
     * @throws RulesException
     */
  public void saveDecisionTables(OutputStream out, RSession session, String rulesetname) throws RulesException {
      RuleSet       rs       = rd.getRuleSet(RName.getRName(rulesetname));
        EntityFactory ef       = rs.getEntityFactory(session);
       
        PrintStream  ps  = new PrintStream(out);
        Iterator<RName> tables = ef.getDecisionTableRNameIterator();
        ps.println("<decision_tables>");
        while(tables.hasNext()){
            RName dtname = tables.next();
            ef.getDecisionTable(dtname).writeXML(ps);
        }
        ps.println("\n</decision_tables>");
       
  }
View Full Code Here

Examples of com.dtrules.session.EntityFactory

        }
    }

    public void saveEDD(RSession session, String rulesetname) throws RulesException {
        RuleSet       rs       = rd.getRuleSet(RName.getRName(rulesetname));
        EntityFactory ef       = rs.getEntityFactory(session);
        String        filepath = rs.getFilepath();
        String        filename = rs.getEDD_XMLName();
       
        OutputStream out;
        try {
            out = new FileOutputStream(filepath+filename);
        } catch (FileNotFoundException e) {
            throw new RulesException(
                    "OutputFileCreationError",
                    "saveDecisionTables",
                    "An error occured openning the file: "+filepath+filename+"\n"+e
                   );
        }
        PrintStream  ps  = new PrintStream(out);
        Iterator<RName> entities = ef.getEntityRNameIterator();
        ps.println("<entity_data_dictionary>");
        while(entities.hasNext()){
            RName ename = entities.next();
            ef.findRefEntity(ename).writeXML(ps);
        }
        ps.println("\n</entity_data_dictionary>");
  }
View Full Code Here

Examples of com.dtrules.session.EntityFactory

  public RDecisionTable(IRSession session, String name) throws RulesException{
        this.session = session;
        ruleset      = session.getRuleSet();
    dtname       = RName.getRName(name,true);
   
        EntityFactory ef = ruleset.getEntityFactory(session);
        RDecisionTable dttable =ef.findDecisionTable(RName.getRName(name));
        if(dttable != null){
            new CompilerError(CompilerError.Type.TABLE,"Duplicate Decision Tables Found",0,0);
    }   
  }
View Full Code Here

Examples of com.dtrules.session.EntityFactory

            }catch(NullPointerException e){
                throw new RulesException("undefined", "PerformCatchError",
                        "The table '"+table.stringValue()+"' is undefined");
            }catch(RulesException e){
                IRSession     session       = state.getSession();
                EntityFactory ef            = session.getEntityFactory();  
                IREntity      errorEntity   = ef.findRefEntity(error).clone(session).rEntityValue();
                state.entitypush(errorEntity);
               
                // If any of the following puts fail (because the given entity doesn't define them), then
                // simply carry on your merry way.  The user can define these fields if they need them,
                // and they don't need to define them if they don't need them.
View Full Code Here

Examples of com.dtrules.session.EntityFactory

     * @param outputXMLName
     * @throws Exception
     */
    public void convertEDDs(RuleSet rs, String excelName, String outputXMLName) throws Exception {
       
        EntityFactory    ef       = new EntityFactory(rs);
        Iterator<String> includes = rs.getIncludedRuleSets().iterator();
       
        while(excelName != null ){
            File excel = new File(rs.getSystemPath()+"/"+excelName);
            if(excel.isDirectory()){
                File files[] = excel.listFiles();
                for(File file : files){
                    String filename = file.getName().toLowerCase();
                    if( !file.isDirectory() && (filename.endsWith(".xls")||filename.endsWith(".xml"))){
                        convertEDD(ef, rs,file.getAbsolutePath());
                    }
                }
            }else{
                convertEDD(ef,rs,excelName);
            }
            if(includes.hasNext()){
                String includedSet = includes.next();
                excelName = rs.getRulesDirectory().getRuleSet(includedSet).getExcel_edd();
            }else{
                excelName = null;
            }
        }
       
        XMLPrinter   xptr  = new XMLPrinter(new FileOutputStream(outputXMLName));
        xptr.opentag("entity_data_dictionary","version","2","xmlns:xs","http://www.w3.org/2001/XMLSchema");
        ef.writeAttributes(xptr);
        xptr.close();
    }
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.