Examples of insertAll()


Examples of org.eclipse.imp.pdb.facts.ISetWriter.insertAll()

  private int idNum = 0;

  public ITuple getGraph() {
    ISetWriter sw = vf.setWriter(tf.tupleType(tf.stringType(),
        tf.stringType(), tf.stringType(), tf.integerType()));
    sw.insertAll(ids.values());
    return vf.tuple(sw.done(), edges);
  }

  public IString addFact(IFact<?> fact, String name, int status) {
    if (!ids.containsKey(fact)) {
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.ISetWriter.insertAll()

  @Override
  public <U extends IValue> Result<U> fieldAccess(String name, TypeStore store) {
    if (name.equals(type.getKeyLabel())) {
      ISetWriter w = getValueFactory().setWriter();
      w.insertAll(value);
      return makeResult(getTypeFactory().setType(type.getKeyType()), w.done(), ctx);
    }
    else if (name.equals(type.getValueLabel())) {
      ISetWriter w = getValueFactory().setWriter();
      Iterator<IValue> it = value.valueIterator();
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.ISetWriter.insertAll()

       
        IConstructor choice = definitions.get(adt);
        ISetWriter alts = vf.setWriter();
       
        if (choice != null) {
          alts.insertAll((ISet) choice.get("alternatives"));
        }
       
        IListWriter w = vf.listWriter();
        if (type.hasFieldNames()) {
          for(int i = 0; i < type.getArity(); i++) {
View Full Code Here

Examples of org.h2.jaqu.Db.insertAll()

        new AliasMapTest().test();
    }

    public void test() throws Exception {
        Db db = Db.open("jdbc:h2:mem:", "sa", "sa");
        db.insertAll(Product.getList());

        Product p = new Product();
        List<Product> products = db
            .from(p)
            .where(p.unitsInStock).is(9)
View Full Code Here

Examples of org.h2.jaqu.Db.insertAll()

    public void test() throws Exception {
        String create = "CREATE TABLE CLOB_TEST(ID INT PRIMARY KEY, WORDS {0})";
        Db db = Db.open("jdbc:h2:mem:", "sa", "sa");
        db.executeUpdate(MessageFormat.format(create, "VARCHAR(255)"));
        db.insertAll(StringRecord.getList());
        testSimpleUpdate(db, "VARCHAR fail");
        db.close();

        db = Db.open("jdbc:h2:mem:", "sa", "sa");
        db.executeUpdate(MessageFormat.format(create, "TEXT"));
View Full Code Here

Examples of org.h2.jaqu.Db.insertAll()

        testSimpleUpdate(db, "VARCHAR fail");
        db.close();

        db = Db.open("jdbc:h2:mem:", "sa", "sa");
        db.executeUpdate(MessageFormat.format(create, "TEXT"));
        db.insertAll(StringRecord.getList());
        testSimpleUpdate(db, "CLOB fail because of single quote artifacts");
        db.close();
    }

    private void testSimpleUpdate(Db db, String failureMsg) {
View Full Code Here

Examples of org.h2.jaqu.Db.insertAll()

        TestDbUpgrader dbUpgrader = new TestDbUpgrader();
        db.setDbUpgrader(dbUpgrader);

        List<SupportedTypes> original = SupportedTypes.createList();
        db.insertAll(original);

        assertEquals(1, dbUpgrader.oldVersion.get());
        assertEquals(2, dbUpgrader.newVersion.get());
        db.close();
    }
View Full Code Here

Examples of org.h2.jaqu.Db.insertAll()

    private void testTableUpgrade() {
        Db db = Db.open("jdbc:h2:mem:", "sa", "sa");

        // insert first, this will create version record automatically
        List<SupportedTypes> original = SupportedTypes.createList();
        db.insertAll(original);

        // reset the dbUpgrader (clears the update check cache)
        TestDbUpgrader dbUpgrader = new TestDbUpgrader();
        db.setDbUpgrader(dbUpgrader);
View Full Code Here

Examples of org.h2.jaqu.Db.insertAll()

    private void testColumnInheritanceAnnotation() {
        ProductInheritedAnnotation table = new ProductInheritedAnnotation();
        Db db = Db.open("jdbc:h2:mem:", "sa", "sa");
        List<ProductInheritedAnnotation> inserted = ProductInheritedAnnotation.getData();
        db.insertAll(inserted);

        List<ProductInheritedAnnotation> retrieved = db.from(table).select();

        for (int j = 0; j < retrieved.size(); j++) {
            ProductInheritedAnnotation i = inserted.get(j);
View Full Code Here

Examples of org.h2.jaqu.Db.insertAll()

    private void testCreateTableIfRequiredAnnotation() {
        // tests JQTable.createTableIfRequired=false
        try {
            Db noCreateDb = Db.open("jdbc:h2:mem:", "sa", "sa");
            noCreateDb.insertAll(ProductNoCreateTable.getList());
            noCreateDb.close();
        } catch (RuntimeException r) {
            SQLException s = (SQLException) r.getCause();
            assertEquals(ErrorCode.TABLE_OR_VIEW_NOT_FOUND_1, s.getErrorCode());
        }
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.