Examples of XPathGetter


Examples of ch.inftec.ju.util.xml.XPathGetter

     * @param resourcePath Resource path to dataset XML
     * @return ExportBuilder to allow for chaining
     */
    public ExportBuilder setTableNamesCasingByDataSet(String resourcePath) {
      try {
        this.exportItems.setCasedTableNames(new XPathGetter(XmlUtils.loadXml(
            JuUrl.resource().relativeTo(DbDataUtil.class).get(resourcePath))).getNodeNames("dataset/*"));
      } catch (Exception ex) {
        throw new JuDbException("Couldn't load table names data set " + resourcePath, ex);
      }
      return this;
View Full Code Here

Examples of ch.inftec.ju.util.xml.XPathGetter

     * @param sortedByPrimaryKey If true, the entries will be sorted by primary key
     * @return ExportBuilder to allow for chaining
     */
    public ExportBuilder addTablesByDataSet(URL resourceUrl, boolean sortedByPrimaryKey) {
      try {
        Set<String> tableNames = JuCollectionUtils.asSameOrderSet(new XPathGetter(XmlUtils.loadXml(resourceUrl)).getNodeNames("dataset/*"));
        for (String tableName : tableNames) {
          if (sortedByPrimaryKey) {
            this.addTableSorted(tableName);
          } else {
            this.addTable(tableName);
View Full Code Here

Examples of ch.inftec.ju.util.xml.XPathGetter

   */
  public final void init(EntityManager em, Document doc) {
    this.em = em;
    this.emUtil = new JuEmUtil(em);
   
    if (doc != null) this.xg = new XPathGetter(doc);
  }
View Full Code Here

Examples of ch.inftec.ju.util.xml.XPathGetter

     * @param resourcePath Resource path to dataset XML
     * @return ExportBuilder to allow for chaining
     */
    public ExportBuilder setTableNamesCasingByDataSet(String resourcePath) {
      try {
        this.exportItems.setCasedTableNames(new XPathGetter(XmlUtils.loadXml(
            JuUrl.resource().relativeTo(DbDataUtil.class).get(resourcePath))).getNodeNames("dataset/*"));
      } catch (Exception ex) {
        throw new JuDbException("Couldn't load table names data set " + resourcePath, ex);
      }
      return this;
View Full Code Here

Examples of ch.inftec.ju.util.xml.XPathGetter

     * @param sortedByPrimaryKey If true, the entries will be sorted by primary key
     * @return ExportBuilder to allow for chaining
     */
    public ExportBuilder addTablesByDataSet(URL resourceUrl, boolean sortedByPrimaryKey) {
      try {
        Set<String> tableNames = JuCollectionUtils.asSameOrderSet(new XPathGetter(XmlUtils.loadXml(resourceUrl)).getNodeNames("dataset/*"));
        for (String tableName : tableNames) {
          if (sortedByPrimaryKey) {
            this.addTableSorted(tableName);
          } else {
            this.addTable(tableName);
View Full Code Here

Examples of ch.inftec.ju.util.xml.XPathGetter

     * @param resourcePath Resource path to dataset XML
     * @return ExportBuilder to allow for chaining
     */
    public ExportBuilder setTableNamesCasingByDataSet(String resourcePath) {
      try {
        this.exportItems.setCasedTableNames(new XPathGetter(XmlUtils.loadXml(
            JuUrl.resource().relativeTo(DbDataUtil.class).get(resourcePath))).getNodeNames("dataset/*"));
      } catch (Exception ex) {
        throw new JuDbException("Couldn't load table names data set " + resourcePath, ex);
      }
      return this;
View Full Code Here

Examples of ch.inftec.ju.util.xml.XPathGetter

     * @param sortedByPrimaryKey If true, the entries will be sorted by primary key
     * @return ExportBuilder to allow for chaining
     */
    public ExportBuilder addTablesByDataSet(URL resourceUrl, boolean sortedByPrimaryKey) {
      try {
        Set<String> tableNames = JuCollectionUtils.asSameOrderSet(new XPathGetter(XmlUtils.loadXml(resourceUrl)).getNodeNames("dataset/*"));
        for (String tableName : tableNames) {
          if (sortedByPrimaryKey) {
            this.addTableSorted(tableName);
          } else {
            this.addTable(tableName);
View Full Code Here

Examples of ch.inftec.ju.util.xml.XPathGetter

    te.setName("Export Test");
    this.em.persist(te);
   
    DbDataUtil du = new DbDataUtil(this.em);
    Document doc = du.buildExport().addTable("TestingEntity").writeToXmlDocument();
    XPathGetter xg = new XPathGetter(doc);
    logger.debug("Exported XML\n" + XmlUtils.toString(doc, false, true));
   
    Assert.assertEquals(1, xg.getArray("//TestingEntity").length);
    Assert.assertEquals("Export Test", xg.getSingle("//TestingEntity/@name"));
  }
View Full Code Here

Examples of ch.inftec.ju.util.xml.XPathGetter

    this.em.persist(te);
   
    // Export table with camel case
    DbDataUtil du = new DbDataUtil(this.em);
    Document doc = du.buildExport().addTable("TestingEntity").writeToXmlDocument();
    XPathGetter xg = new XPathGetter(doc);
    logger.debug("Exported XML\n" + XmlUtils.toString(doc, false, true));
   
    Assert.assertEquals(1, xg.getArray("//TestingEntity").length);
    Assert.assertEquals("Export Test", xg.getSingle("//TestingEntity/@name"));
  }
View Full Code Here

Examples of ch.inftec.ju.util.xml.XPathGetter

    this.em.persist(te);
   
    // Export table with camel case
    DbDataUtil du = new DbDataUtil(this.em);
    Document doc = du.buildExport().addTable("testingentity").writeToXmlDocument();
    XPathGetter xg = new XPathGetter(doc);
    logger.debug("Exported XML\n" + XmlUtils.toString(doc, false, true));
   
    Assert.assertEquals(1, xg.getArray("//testingentity").length);
    Assert.assertEquals("Export Test", xg.getSingle("//testingentity/@name"));
  }
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.