Package org.wikier.trioo.jtrioo.generators

Examples of org.wikier.trioo.jtrioo.generators.SelectQueryGenerator


  public Object find(Class resourceClass, String uri) {
    RDFMetaResource metaResource = this.session.getMetaRDFResource(resourceClass);
    if (metaResource == null) {
      return null;
    } else {
      SelectQueryGenerator sqg = QueryGeneratorFactory.createSelectQueryGenerator();
      sqg.setUri(uri);
      sqg.visit(metaResource);
      QueryCodeGenerator qg = new QueryCodeGenerator();
      qg.visit(sqg.getQuery());
      QueryExecutor qe = this.session.getQueryExecutor();
      ResultSet rs = qe.execSelect(qg.toString());
      Object obj = null;
      if (rs.hasNext()) {
        obj = InstanceGenerator.create(resourceClass, rs.next());
View Full Code Here


  public Object[] findAll(Class resourceClass) {
    RDFMetaResource metaResource = this.session.getMetaRDFResource(resourceClass);
    if (metaResource == null) {
      return new Object[]{};
    } else {
      SelectQueryGenerator sqg = QueryGeneratorFactory.createSelectQueryGenerator();
      sqg.visit(metaResource);
      QueryCodeGenerator qg = new QueryCodeGenerator();
      qg.visit(sqg.getQuery());
      QueryExecutor qe = this.session.getQueryExecutor();
      ResultSet rs = qe.execSelect(qg.toString());
      List<Object> objs = new ArrayList<Object>();
      while (rs.hasNext()) {
        objs.add(InstanceGenerator.create(resourceClass, rs.next()));
View Full Code Here

TOP

Related Classes of org.wikier.trioo.jtrioo.generators.SelectQueryGenerator

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.