Package org.apache.ws.jaxme.sqls

Examples of org.apache.ws.jaxme.sqls.Index$Name


   */
  public void testIndexNames() {
    SQLGenerator gen = getSQLGenerator();
    Table table = getBasicTable();
    for (int i = 0;  i < 10;  i++) {
      Index index = table.newIndex();
      index.addColumn("MyName");
      String s = (String) gen.getCreate(index).iterator().next();
      assertEquals("CREATE INDEX MyTable_I" + i + " ON MySchema.MyTable (MyName)", s);
    }

    Collection coll = gen.getCreate(schema, true);
View Full Code Here


      mtName.setLength(60);
      BinaryColumn mtSig = (BinaryColumn) mt.newColumn("SIG", Column.Type.BINARY);
      mtSig.setLength(16);
      mt.newColumn("DATE", Column.Type.DATE);
     
      Index primaryKey = mt.newPrimaryKey();
      primaryKey.addColumn(mtId);
      primaryKey.addColumn(mtVer);
      mainTable = mt;
    }
    return mainTable;
  }
View Full Code Here

      stAddress.setLength(60);
      StringColumn stEmail = (StringColumn) st.newColumn("EMAIL", Column.Type.VARCHAR);
      stEmail.setLength(60);
      stEmail.setNullable(true);
     
      Index primaryKey = st.newPrimaryKey();
      primaryKey.addColumn(stId);
     
      ForeignKey foreignKey = st.newForeignKey(getMainTable());
      foreignKey.addColumnLink(stMtId, getMainTable().getColumn("ID"));
      foreignKey.addColumnLink(stMtVer, getMainTable().getColumn("VER"));
     
View Full Code Here

   * a <code>FOREIGN KEY</code> clause.</p>
   */
  protected boolean isForeignKeyPartOfCreateTable() { return false; }

  protected String createPrimaryKeyAsPartOfCreateTable(Table pTable) {
    Index index = pTable.getPrimaryKey();
    if (index == null) {
      return null;
    }
    StringBuffer sb = new StringBuffer();
    sb.append("PRIMARY KEY").append(" (");
    boolean first = true;
    for (Iterator iter = index.getColumns();  iter.hasNext()) {
      if (first) {
        first = false;
      } else {
        sb.append(", ");
      }
View Full Code Here

      sb.append(s).append(getCreate((Column) iter.next()));
      s = "," + lf + indent;
    }

    for (Iterator iter = pTable.getIndexes();  iter.hasNext()) {
      Index index = (Index) iter.next();
      String st;
      if (index.isPrimaryKey()  &&  !isPrimaryKeyUniqueIndex()) {
        if (!isPrimaryKeyPartOfCreateTable()) {
          continue;
        }
        st = createPrimaryKeyAsPartOfCreateTable(pTable);
      } else if (index.isUnique()) {
        if (!isUniqueIndexPartOfCreateTable()) {
          continue;
        }
        st = createIndexAsPartOfCreateTable(index);
      } else {
View Full Code Here

  public Collection getCreate(Table pTable, boolean pAll) {
    if (!pAll) { return getCreate(pTable); }
    List result = new ArrayList();
    result.addAll(getCreate(pTable));
    for (Iterator iter = pTable.getIndexes();  iter.hasNext()) {
      Index index = (Index) iter.next();
      if (index.isPrimaryKey() && !isPrimaryKeyUniqueIndex()) {
        if (isPrimaryKeyPartOfCreateTable()) {
          continue;
        }
      } else if (index.isUnique()) {
        if (isUniqueIndexPartOfCreateTable()) {
          continue;
        }
      } else {
        if (isNonUniqueIndexPartOfCreateTable()) {
View Full Code Here

  public Collection getDrop(Table pTable, boolean pAll) {
    if (!pAll) { return getDrop(pTable); }
    List result = new ArrayList();
    for (Iterator iter = pTable.getIndexes();  iter.hasNext()) {
      Index index = (Index) iter.next();
      result.addAll(getDrop(index));
    }
    for (Iterator iter = pTable.getForeignKeys();  iter.hasNext()) {
      ForeignKey key = (ForeignKey) iter.next();
      result.addAll(getDrop(key));
View Full Code Here

      for (String string : findQualifyers) {
        findQualifiers.getFindQualifier().add(string);
      }
      findBusiness.setFindQualifiers(findQualifiers);

      Name name = new Name();
      name.setValue(nameStr);
      findBusiness.getName().add(name);


      logger.debug("FindBusiness " + findBusiness + " sending findBusinesses request..");
      List<Business> businesses = new ArrayList<Business>();
View Full Code Here

    }
    assertEquals(names1.size(), names2.size());
    Iterator<Name> names1Itr = names1.iterator();
    Iterator<Name> names2Itr = names2.iterator();
    while (names1Itr.hasNext()) {
      Name name1 = names1Itr.next();
      Name name2 = names2Itr.next();
      assertEquals(name1.getLang(), name2.getLang());
      assertEquals(name1.getValue(), name2.getValue());
    }
  }
View Full Code Here

      //service
      String lang = "en"; //default to english
      if (uddiService.lang()!=null) {
        lang = uddiService.lang();
      }
      Name name = new Name();
      name.setLang(lang);
      service.setBusinessKey(TokenResolver.replaceTokens(uddiService.businessKey(),properties));
      service.setServiceKey(TokenResolver.replaceTokens(uddiService.serviceKey(),properties));
      if (!"".equals(uddiService.serviceName())) {
        name.setValue(TokenResolver.replaceTokens(uddiService.serviceName(),properties));
      } else if (webServiceAnnotation!=null && !"".equals(webServiceAnnotation.serviceName())) {
        name.setValue(webServiceAnnotation.serviceName());
      } else {
        name.setValue(clazz.getSimpleName());
      }
      service.getName().add(name);
      Description description = new Description();
      description.setLang(lang);
      description.setValue(TokenResolver.replaceTokens(uddiService.description(),properties));
View Full Code Here

TOP

Related Classes of org.apache.ws.jaxme.sqls.Index$Name

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.