Package sos.marshalling

Examples of sos.marshalling.SOSExport$Query


  private List<Tuple2<Query, Float>> prepareValidation(List<TrainingData.Rating> testRatings) {
    List<Tuple2<Query, Float>> validationList = new ArrayList<Tuple2<Query, Float>>();

    for (TrainingData.Rating r : testRatings) {
      validationList.add(new Tuple2<Query, Float>(
        new Query(r.uid, r.iid),
        r.rating));
    }

    return validationList;
  }
View Full Code Here


        ParameterizedType returnType = (ParameterizedType) t;
        final Type[] h = returnType.getActualTypeArguments();
        assert(h.length == 1);
        assert(h[0] instanceof Class);
        Class c = (Class) h[0];
        Query q = handle.createQuery(s.value()).map(c);
        if (args != null) bindArguments(method.isAnnotationPresent(BindBy.class) ?
                                        method.getAnnotation(BindBy.class).value() :
                                        BindType.Position, q, args);
        return f.doit(q);
    }
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    private Object handleInstance(Select s, Method method, Object[] args)
    {
        Query q = handle.createQuery(s.value()).map(method.getReturnType());
        if (args != null) bindArguments(method.isAnnotationPresent(BindBy.class) ?
                                        method.getAnnotation(BindBy.class).value() :
                                        BindType.Position, q, args);
        if (args != null) bindArguments(method.isAnnotationPresent(BindBy.class) ?
                                        method.getAnnotation(BindBy.class).value() :
                                        BindType.Position, q, args);
        q.setMaxRows(1);
        return q.first();
    }
View Full Code Here

            return new SqlStatementCustomizer()
            {
                @Override
                public void apply(SQLStatement s) throws SQLException
                {
                   Query q = (Query) s;
                   NamingStrategy dbNamingStrategy = ((MapResultForSnakeCaseAsBean) annotation).dbNamingStrategy();
                   NamingStrategy fieldNamingStrategy = ((MapResultForSnakeCaseAsBean) annotation).fieldNamingStrategy();
                   q.registerMapper(new FormatterAwareBeanMapperFactory(dbNamingStrategy,fieldNamingStrategy));
                }
            };
        }
View Full Code Here

        @Override
        public SqlStatementCustomizer createForMethod(final Annotation annotation, Class sqlObjectType, Method method) {
            return new SqlStatementCustomizer() {
                @Override
                public void apply(SQLStatement s) throws SQLException {
                    Query q = (Query) s;
                    q.registerMapper(new TranslationAwareBeanMapperFactory());
                }
            };
        }
View Full Code Here

        @Override
        public SqlStatementCustomizer createForMethod(final Annotation annotation, Class sqlObjectType, Method method) {
            return new SqlStatementCustomizer() {
                @Override
                public void apply(SQLStatement s) throws SQLException {
                    Query q = (Query) s;
                    Class<? extends TranslatingStrategyAware> translater = ((MapResultForSnakeCaseAsBean) annotation).translaterClass();
                    q.registerMapper(new TranslationAwareBeanMapperFactory(translater));
                }
            };
        }
View Full Code Here

            _sosConnection = SOSConnection.createInstance(_configFile
                    .toString(), _sosLogger);
            _sosConnection.connect();

            SOSExport export = new SOSExport(_sosConnection, _outputFile
                    .toString(), "EXPORT", _sosLogger);

            prepareExport(export);

            export.doExport();
            System.out.println("");
            System.out.println("Export erfolgreich beendet.");

        } catch (Exception e) {
            throw new Exception("error in SOSExportProcessor: "
View Full Code Here

    String selSettings = "SELECT * FROM "+JobSchedulerManagedObject.getTableSettings()+" WHERE \"APPLICATION\" IN ('job_type/local/?', 'job_type/global/?', 'job_type/mixed/?')";
    String selSettingsOrders = "SELECT * FROM "+JobSchedulerManagedObject.getTableSettings()+" WHERE \"APPLICATION\" IN ('order_type/local/?', 'order_type/global/?', 'order_type/mixed/?')";
    String selOrders = "SELECT * FROM "+JobSchedulerManagedObject.getTableManagedOrders()+" WHERE \"JOB_CHAIN\"='?'";
   
    //TODO: wofuer ist 3. Parameter?   
    SOSExport export = new SOSExport(conn,xmlFile, "DOCUMENT", sosLogger);
    int model = export.query(JobSchedulerManagedObject.getTableManagedModels(),"ID", selManagedModel);
    int job = export.query(JobSchedulerManagedObject.getTableManagedJobs(),"ID",selManagedJobs,"ID", model);
    int orders = export.query(JobSchedulerManagedObject.getTableManagedOrders(),"ID",selOrders,"NAME",model);
    int jobTypes = export.query(JobSchedulerManagedObject.getTableManagedJobTypes(),"TYPE", selJobTypes,"JOB_TYPE", job);
    int jobTypes2 = export.query(JobSchedulerManagedObject.getTableManagedJobTypes(),"TYPE", selJobTypes,"JOB_TYPE", orders);
    int settings = export.query(JobSchedulerManagedObject.getTableSettings(), "APPLICATION,SECTION,NAME",selSettings,"TYPE,TYPE,TYPE",jobTypes);
    int settingsOrders = export.query(JobSchedulerManagedObject.getTableSettings(), "APPLICATION,SECTION,NAME",selSettings,"TYPE,TYPE,TYPE",jobTypes2);
   
   
   
    export.doExport();
   
   
  }
View Full Code Here

        // SOSStandardLogger("c:/settings_import_log.txt",SOSStandardLogger.DEBUG9);
        SOSStandardLogger logger = new SOSStandardLogger(
                SOSStandardLogger.DEBUG9);
        try {

            SOSExport export = new SOSExport(this.connection, file,
                    this.applicationName, logger);
            export.query(this.settings.source, this.settings.entryApplication
                    + "," + this.settings.entrySection + ","
                    + this.settings.entryName, sql.toString());

            String rc = export.doExport();

            if (!rc.equals("") && file.equals("")) {
                this.response.setContentType("application/xml");
                this.response.setHeader("Content-Disposition",
                        "attachment; filename=settings.xml");
View Full Code Here

    String selManagedJobs = "SELECT * FROM "+JobSchedulerManagedObject.getTableManagedJobs()+" WHERE \"ID\"="+jobID;
    String selJobTypes = "SELECT * FROM "+JobSchedulerManagedObject.getTableManagedJobTypes()+" WHERE \"TYPE\"='?'";
    String selSettings = "SELECT * FROM "+JobSchedulerManagedObject.getTableSettings()+" WHERE \"APPLICATION\" IN ('job_type/local/?', 'job_type/global/?', 'job_type/mixed/?')";
   
       
    SOSExport export = new SOSExport(conn,xmlFile, "DOCUMENT", sosLogger);
    int job = export.query(JobSchedulerManagedObject.getTableManagedJobs(),"ID",selManagedJobs);
    int jobTypes = export.query(JobSchedulerManagedObject.getTableManagedJobTypes(),"TYPE", selJobTypes,"JOB_TYPE", job);
    int settings = export.query(JobSchedulerManagedObject.getTableSettings(), "APPLICATION,SECTION,NAME",selSettings,"TYPE,TYPE,TYPE",jobTypes);
   
   
   
    export.doExport();
   
   
  }
View Full Code Here

TOP

Related Classes of sos.marshalling.SOSExport$Query

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.