Package org.nutz.dao.sql

Examples of org.nutz.dao.sql.Pojo


        return "SELECT * FROM " + en.getViewName() + " LIMIT 1";
    }
   
    public Pojo fetchPojoId(Entity<?> en, MappingField idField) {
        String autoSql = "select IDENTITY_VAL_LOCAL() as id from " + en.getTableName();
        Pojo autoInfo = new SqlFieldMacro(idField, autoSql);
        autoInfo.setEntity(en);
        return autoInfo;
    }
View Full Code Here


        return DB.H2.name();
    }

    public Pojo fetchPojoId(Entity<?> en, MappingField idField) {
        String autoSql = "SELECT IDENTITY() as $field from $view";
        Pojo autoInfo = new SqlFieldMacro(idField, autoSql);
        autoInfo.setEntity(en);
        return autoInfo;
    }
View Full Code Here

        return "SELECT * FROM " + en.getViewName() + " LIMIT 1";
    }

    public Pojo fetchPojoId(Entity<?> en, MappingField idField) {
        String autoSql = "SELECT @@@@IDENTITY";
        Pojo autoInfo = new SqlFieldMacro(idField, autoSql);
        autoInfo.setEntity(en);
        return autoInfo;
    }
View Full Code Here

        return "SELECT top 1 * FROM " + en.getViewName();
    }
   
    public Pojo fetchPojoId(Entity<?> en, MappingField idField) {
        String autoSql = "SELECT @@@@IDENTITY as $field";
        Pojo autoInfo = new SqlFieldMacro(idField, autoSql);
        autoInfo.setEntity(en);
        return autoInfo;
    }
View Full Code Here

        return true;
    }
   
    public Pojo fetchPojoId(Entity<?> en, MappingField idField) {
      String autoSql = "SELECT MAX($field) AS $field FROM $view";
        Pojo autoInfo = new SqlFieldMacro(idField, autoSql);
        autoInfo.setEntity(en);
        return autoInfo;
    }
View Full Code Here

    return "SELECT * FROM " + en.getViewName() + " LIMIT 1";
  }

  public Pojo fetchPojoId(Entity<?> en, MappingField idField) {
    String autoSql = "SELECT @@@@IDENTITY";
    Pojo autoInfo = new SqlFieldMacro(idField, autoSql);
    autoInfo.setEntity(en);
    return autoInfo;
  }
View Full Code Here

        throw Lang.noImplement();
    }
   
    public Pojo fetchPojoId(Entity<?> en, MappingField idField) {
        String autoSql = "SELECT MAX($field) AS $field FROM $view";
        Pojo autoInfo = new SqlFieldMacro(idField, autoSql);
        autoInfo.setEntity(en);
        return autoInfo;
    }
View Full Code Here

    public void visit(Object obj, LinkField lnk) {
        if (lnk instanceof ManyManyLinkField) {
            ManyManyLinkField mm = (ManyManyLinkField) lnk;
            Entity<?> en = opt.makeEntity(mm.getRelationName(), map);
            Pojo pojo = opt.maker().makeUpdate(en, null);
            pojo.setOperatingObject(map);
            pojo.append(items);
            opt.add(pojo);
        }
    }
View Full Code Here

import org.nutz.dao.util.Pojos;

public class DoClearLinkVisitor extends AbstractLinkVisitor {

    public void visit(final Object obj, final LinkField lnk) {
        Pojo pojo = opt.maker().makeDelete(lnk.getLinkedEntity());
        pojo.append(Pojos.Items.cnd(lnk.createCondition(obj)));
        pojo.setOperatingObject(obj);
        opt.add(pojo);
    }
View Full Code Here

    }
    return "";
  }

  public static Pojo pojo(JdbcExpert expert, Entity<?> en, SqlType type) {
    Pojo pojo = expert.createPojo(type);
    pojo.getContext().setFieldMatcher(FieldFilter.get(en.getType()));
    return pojo;
  }
View Full Code Here

TOP

Related Classes of org.nutz.dao.sql.Pojo

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.