Package org.eobjects.metamodel

Examples of org.eobjects.metamodel.UpdateScript


  }

  private synchronized final void flushBuffer() {
    if (!_buffer.isEmpty()) {
      logger.info("Flushing {} rows in write buffer", _buffer.size());
      _dataContext.executeUpdate(new UpdateScript() {
        @Override
        public void run(UpdateCallback callback) {
          for (Object[] rowData = _buffer.poll(); rowData != null; rowData = _buffer.poll()) {
            RowInsertionBuilder insertBuilder = callback.insertInto(getTable());
            for (int i = 0; i < _columns.length; i++) {
View Full Code Here


          parentFile.mkdirs();
        }
        dataContext = new CsvDataContext(file, getConfiguration(separatorChar, quoteChar));

        final Schema schema = dataContext.getDefaultSchema();
        dataContext.executeUpdate(new UpdateScript() {
          @Override
          public void run(UpdateCallback callback) {
            TableCreationBuilder tableBuilder = callback.createTable(schema, "table");
            for (String header : headers) {
              tableBuilder.withColumn(header);
View Full Code Here

  private static Table getTable(UpdateableDataContext dataContext, final String sheetName, final InputColumn<?>[] columns) {
    final Schema schema = dataContext.getDefaultSchema();
    Table table = schema.getTableByName(sheetName);
    if (table == null) {
      final MutableRef<Table> tableRef = new MutableRef<Table>();
      dataContext.executeUpdate(new UpdateScript() {
        @Override
        public void run(UpdateCallback callback) {
          TableCreationBuilder tableBuilder = callback.createTable(schema, sheetName);
          for (InputColumn<?> inputColumn : columns) {
            tableBuilder.withColumn(inputColumn.getName());
View Full Code Here

TOP

Related Classes of org.eobjects.metamodel.UpdateScript

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.