Package org.restsql.core.sqlresource

Examples of org.restsql.core.sqlresource.SqlResourceDefinition


      JAXBContext context;
      try {
        context = JAXBContext.newInstance(ObjectFactory.class);
        final Unmarshaller unmarshaller = context.createUnmarshaller();
        unmarshaller.setSchema(null);
        final SqlResourceDefinition definition = ((JAXBElement<SqlResourceDefinition>) unmarshaller
            .unmarshal(inputStream)).getValue();
        final SqlBuilder sqlBuilder = Factory.getSqlBuilder();
        sqlResource = new SqlResourceImpl(resName, definition, Factory.getSqlResourceMetaData(
            resName, definition, sqlBuilder), sqlBuilder, new ArrayList<Trigger>());
        sqlResources.put(resName, sqlResource);
View Full Code Here


   * @throws GenerationException if a database access or file write error occurs
   */
  protected int createDefs(final File subDirObj, final String databaseName, final String exclusionPattern) throws GenerationException {
    // Create definition object
    final ObjectFactory objectFactory = new ObjectFactory();
    final SqlResourceDefinition def = objectFactory.createSqlResourceDefinition();
    final Query query = objectFactory.createQuery();
    def.setQuery(query);
    final MetaData metaData = objectFactory.createMetaData();
    final Database database = objectFactory.createDatabase();
    database.setDefault(databaseName);
    metaData.setDatabase(database);
    final Table table = objectFactory.createTable();
    table.setRole("Parent");
    metaData.getTable().add(table);
    def.setMetadata(metaData);

    StringBuilder queryString = null;
    int defsCreated = 0;

    // Now inspect the information schema for columns and tables, build definition and write the files
View Full Code Here

TOP

Related Classes of org.restsql.core.sqlresource.SqlResourceDefinition

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.