Package org.xmlBlaster.contrib.dbwriter.info

Examples of org.xmlBlaster.contrib.dbwriter.info.SqlInfo


      log.info("SUCCESS");
   }

  
   private SqlInfo createMsg(I_Info info, String oldFirst, String oldSecond, String first, String second, String fifth, int replKey) {
      SqlInfo ret = new SqlInfo(info);
      SqlDescription description = new SqlDescription(info);
      // description.setCommand("UPDATE");
      description.setCommand(ReplicationConstants.REPLICATION_CMD);
      description.setIdentity("TABLE1");
      ret.setDescription(description);
      SqlRow row = new SqlRow(info, 0);
      row.setColumn(new ClientProperty("FIRST", null, null, first));
      row.setColumn(new ClientProperty("SECOND", null, null, second));
      row.setColumn(new ClientProperty("FIFTH", null, null, fifth));

      row.setAttribute(new ClientProperty("transaction", null, null, "" + replKey));
      row.setAttribute(new ClientProperty("guid", null, null, "" + replKey));
      row.setAttribute(new ClientProperty("dbId", null, null, "NULL"));
      row.setAttribute(new ClientProperty("tableName", null, null, "TABLE1"));
      row.setAttribute(new ClientProperty("version", null, null, "0.5"));
      row.setAttribute(new ClientProperty("action", null, null, "UPDATE"));
      StringBuffer buf = new StringBuffer(1024);
      buf.append("<col name='FIRST'>").append(oldFirst).append("</col>\n");
      buf.append("<col name='SECOND'>").append(oldSecond).append("</col>\n");

      row.setAttribute(new ClientProperty("oldContent", null, "forcePlain", buf.toString()));
      row.setAttribute(new ClientProperty("schema", null, null, "XMLBLASTER"));
      row.setAttribute(new ClientProperty("replKey", null, null, "" + replKey));
      ret.getRows().add(row);
      return ret;
     
   }
View Full Code Here


        
         Set vals = searchableConfig.getSearchableColumnNames(null, "XMLBLASTER", "TABLE1");
         String[] ret = (String[])vals.toArray(new String[vals.size()]);
         assertEquals("Wrong number of colums found", 4, ret.length);
        
         SqlInfo sqlInfo = new SqlInfo(info);
         Connection conn = pool.reserve();
         sqlInfo.fillMetadata(conn, null, "XMLBLASTER", "TABLE1", null, null);
         pool.release(conn);
        
         SqlDescription description = sqlInfo.getDescription();
         boolean isConfigured = description.isColumnSearchConfigured(null);
         assertTrue("shall be configured", isConfigured);
        
         isConfigured = description.isColumnSearchConfigured("FIRST");
         assertTrue("shall be configured", isConfigured);
         isConfigured = description.isColumnSearchConfigured("SECOND");
         assertTrue("shall be configured", isConfigured);
         isConfigured = description.isColumnSearchConfigured("THIRD");
         assertFalse("shall not be configured", isConfigured);
         isConfigured = description.isColumnSearchConfigured("FOURTH");
         assertTrue("shall be configured (since it could be added later)", isConfigured);
        
         String oldFirst = "oldOne";
         String oldSecond = "oldTwo";
         String first = "one";
         String second = "two";
         String fifth = "five";
         int replKey = 1;
         SqlInfo sql = createMsg(info, oldFirst, oldSecond, first, second, fifth, replKey);
        
         String xml = sql.toXml("");
         log.info(xml);
        
         SqlInfoParser parser = new SqlInfoParser();
         parser.init(info);
        
View Full Code Here

TOP

Related Classes of org.xmlBlaster.contrib.dbwriter.info.SqlInfo

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.