Merge branch 'master' into 5.x
authorKasper Sørensen <i.am.kasper.sorensen@gmail.com>
Wed, 10 May 2017 03:40:08 +0000 (20:40 -0700)
committerKasper Sørensen <i.am.kasper.sorensen@gmail.com>
Wed, 10 May 2017 03:53:48 +0000 (20:53 -0700)
# Conflicts:
# CHANGES.md
# cassandra/pom.xml
# core/pom.xml
# couchdb/pom.xml
# csv/pom.xml
# elasticsearch/common/pom.xml
# elasticsearch/native/pom.xml
# elasticsearch/pom.xml
# elasticsearch/rest/pom.xml
# elasticsearch/rest/src/main/java/org/apache/metamodel/elasticsearch/rest/ElasticSearchRestDataContext.java
# excel/pom.xml
# fixedwidth/pom.xml
# fixedwidth/src/main/java/org/apache/metamodel/fixedwidth/FixedWidthColumnSpec.java
# fixedwidth/src/main/java/org/apache/metamodel/fixedwidth/FixedWidthConfiguration.java
# fixedwidth/src/main/java/org/apache/metamodel/fixedwidth/FixedWidthConfigurationReader.java
# full/pom.xml
# hadoop/pom.xml
# hbase/pom.xml
# jdbc/pom.xml
# jdbc/src/test/java/org/apache/metamodel/jdbc/integrationtests/PostgresqlTest.java
# json/pom.xml
# mongodb/common/pom.xml
# mongodb/mongo2/pom.xml
# mongodb/mongo3/pom.xml
# mongodb/pom.xml
# neo4j/pom.xml
# openoffice/pom.xml
# pojo/pom.xml
# pom.xml
# salesforce/pom.xml
# spring/pom.xml
# sugarcrm/pom.xml
# xml/pom.xml

20 files changed:
1  2 
CHANGES.md
core/src/main/java/org/apache/metamodel/query/FilterItem.java
core/src/main/java/org/apache/metamodel/query/builder/AbstractFilterBuilder.java
core/src/main/java/org/apache/metamodel/query/builder/AbstractQueryFilterBuilder.java
core/src/main/java/org/apache/metamodel/query/builder/FilterBuilder.java
dynamodb/pom.xml
elasticsearch/rest/src/main/java/org/apache/metamodel/elasticsearch/rest/ElasticSearchRestDataContext.java
excel/src/test/java/org/apache/metamodel/excel/ExcelDataContextTest.java
fixedwidth/pom.xml
fixedwidth/src/main/java/org/apache/metamodel/fixedwidth/FixedWidthDataContext.java
jdbc/pom.xml
jdbc/src/main/java/org/apache/metamodel/jdbc/JdbcDataContext.java
jdbc/src/main/java/org/apache/metamodel/jdbc/JdbcDeleteBuilder.java
jdbc/src/main/java/org/apache/metamodel/jdbc/JdbcInsertBuilder.java
jdbc/src/main/java/org/apache/metamodel/jdbc/JdbcUpdateBuilder.java
jdbc/src/test/java/org/apache/metamodel/jdbc/JdbcTestTemplates.java
jdbc/src/test/java/org/apache/metamodel/jdbc/integrationtests/PostgresqlTest.java
pom.xml
salesforce/pom.xml
salesforce/src/main/java/org/apache/metamodel/salesforce/SalesforceDataContext.java

diff --cc CHANGES.md
@@@ -1,12 -1,31 +1,37 @@@
- ### Apache MetaModel 4.5.4 (work in progress)
 +### Apache MetaModel 5.0
 +
 + * [METAMODEL-6] - Added update summary containing information about changes on returning UpdateableDataContext.executeUpdate(..)
 + * [METAMODEL-222] - Added support for Java 8 lambdas, removed support for Java 7.
 + * [METAMODEL-1087] - Removed deprecated APIs from MetaModel's codebase.
 +
+ ### Apache MetaModel 4.6.0
+  * [METAMODEL-1136] - New connector for Amazon DynamoDB.
+  * [METAMODEL-1134] - Added NOT IN and NOT LIKE operators to WHERE filters.
+  * [METAMODEL-1133] - Made PojoDataContext thread-safe.
+ ### Apache MetaModel 4.5.5
+  * [METAMODEL-1132] - Support native paging on SQL Server and Oracle database.
+  * [METAMODEL-1128] - Fixed bug pertaining to ElasticSearch REST data set scrolling.
+  * [METAMODEL-1118] - Fixed bug pertaining to cloning of FilterItem.LogicalOperator in compiled queries.
+  * [METAMODEL-1111] - Added WHERE rewrite for Oracle when empty strings are considered as NULL.
+  * [METAMODEL-1122] - Optimized the way the Cassandra module executes primary key lookup queries.
+  * [METAMODEL-1109] - Fixed diacritics/encoding issue with Fixed Width reader.
+  * [METAMODEL-1115] - Added support for passing your own PartnerConnection object to the Salesforce.com connector.
+  * [METAMODEL-1113] - Fixed support for ColumnNamingStrategy in CSV connector.
+  * [METAMODEL-1114] - Added support for ColumnNamingStrategy in EBCDIC connector.
+  * [METAMODEL-1119] - Worked around Hive JDBC driver issues, avoiding non-compliant metadata calls.
+  * [METAMODEL-1123] - Fixed the treatment of a Salesforce.com 'currency' value as a number, not a string.
+  * [METAMODEL-1124] - Fixed the date formatting of date values in MS SQL server.
+  * [METAMODEL-1127] - Fixed setting of null Map on postgres
+  
+ ### Apache MetaModel 4.5.4
  
   * [METAMODEL-1099] - Created a new DataContextFactory SPI and a extensible registry of implementations based on ServiceLoader.
+  * [METAMODEL-1099] - Implemented DataContextFactory SPI for connectors: JDBC, CSV, ElasticSearch
+  * [METAMODEL-250] - Added support for EBCDIC files (part of 'fixedwidth' module).
+  * [METAMODEL-1103] - Fixed a bug pertaining to anchoring of wildcards in LIKE operands.
   * [METAMODEL-1088] - Add support for aliases in MongoDB.
   * [METAMODEL-1086] - Fixed encoding issue when CsvDataContext is instantiated with InputStream.
   * [METAMODEL-1094] - Added support for Apache Cassandra version 3.x.
index 0000000,ec95902..1de0cb3
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,61 +1,61 @@@
 -              <version>4.6.1-SNAPSHOT</version>
+ <?xml version="1.0" encoding="UTF-8" ?>
+ <!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+   http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+       <parent>
+               <artifactId>MetaModel</artifactId>
+               <groupId>org.apache.metamodel</groupId>
++              <version>5.0-SNAPSHOT</version>
+       </parent>
+       <modelVersion>4.0.0</modelVersion>
+       <artifactId>MetaModel-dynamodb</artifactId>
+       <name>MetaModel module for Amazon AWS DynamoDB.</name>
+       <dependencies>
+               <dependency>
+                       <groupId>org.apache.metamodel</groupId>
+                       <artifactId>MetaModel-core</artifactId>
+                       <version>${project.version}</version>
+               </dependency>
+               <dependency>
+                       <groupId>com.amazonaws</groupId>
+                       <artifactId>aws-java-sdk-dynamodb</artifactId>
+                       <version>1.11.81</version>
+                       <exclusions>
+                               <exclusion>
+                                       <groupId>commons-logging</groupId>
+                                       <artifactId>commons-logging</artifactId>
+                               </exclusion>
+                       </exclusions>
+               </dependency>
+               <dependency>
+                       <groupId>org.slf4j</groupId>
+                       <artifactId>jcl-over-slf4j</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>org.slf4j</groupId>
+                       <artifactId>slf4j-nop</artifactId>
+                       <scope>test</scope>
+               </dependency>
+               <dependency>
+                       <groupId>junit</groupId>
+                       <artifactId>junit</artifactId>
+                       <scope>test</scope>
+               </dependency>
+       </dependencies>
+ </project>
@@@ -34,13 -36,11 +34,14 @@@ import org.apache.metamodel.query.Query
  import org.apache.metamodel.schema.Column;
  import org.apache.metamodel.schema.Schema;
  import org.apache.metamodel.schema.Table;
+ import org.apache.metamodel.schema.naming.CustomColumnNamingStrategy;
  import org.apache.metamodel.util.DateUtils;
  import org.apache.metamodel.util.FileHelper;
 +import org.apache.metamodel.util.FileResource;
  import org.apache.metamodel.util.Month;
  
 +import junit.framework.TestCase;
 +
  public class ExcelDataContextTest extends TestCase {
  
      /**
Simple merge
@@@ -69,9 -89,24 +69,9 @@@ public class FixedWidthDataContext exte
      }
  
      /**
 -     * Gets the file being read.
 -     * 
 -     * @return a file
 -     * 
 -     * @deprecated use {@link #getResource()} instead.
 -     */
 -    @Deprecated
 -    public File getFile() {
 -        if (_resource instanceof FileResource) {
 -            return ((FileResource) _resource).getFile();
 -        }
 -        return null;
 -    }
 -
 -    /**
       * Gets the resource being read
       * 
-      * @return
+      * @return a {@link Resource} object
       */
      public Resource getResource() {
          return _resource;
diff --cc jdbc/pom.xml
Simple merge
@@@ -22,8 -22,9 +22,10 @@@ import java.lang.reflect.Method
  import java.sql.Connection;
  import java.sql.DatabaseMetaData;
  import java.util.Arrays;
+ import java.util.HashMap;
  import java.util.List;
 +import java.util.Optional;
+ import java.util.Map;
  import java.util.concurrent.TimeUnit;
  
  import javax.swing.table.TableModel;
@@@ -434,42 -478,6 +481,42 @@@ public class PostgresqlTest extends Abs
          }
      }
  
-     
 +    public void testGetGeneratedKeys() throws Exception {
 +        if (!isConfigured()) {
 +            return;
 +        }
 +
 +        final JdbcDataContext dc = new JdbcDataContext(getConnection());
 +        final Schema schema = dc.getDefaultSchema();
 +        final String tableName = "my_table_with_generated_keys";
 +        
 +        if (schema.getTableByName(tableName) != null) {
 +            dc.executeUpdate(new DropTable(schema, tableName));
 +        }
 +
 +        final UpdateSummary updateSummary = dc.executeUpdate(new UpdateScript() {
 +            @Override
 +            public void run(UpdateCallback cb) {
 +                Table table = cb.createTable(schema, tableName).withColumn("id").ofType(ColumnType.INTEGER)
 +                        .ofNativeType("SERIAL").nullable(false).asPrimaryKey().withColumn("foo").ofType(
 +                                ColumnType.STRING).execute();
 +                assertEquals(tableName, table.getName());
 +
 +                cb.insertInto(table).value("foo", "hello").execute();
 +                cb.insertInto(table).value("foo", "world").execute();
 +            }
 +        });
 +
 +        final Optional<Integer> insertedRows = updateSummary.getInsertedRows();
 +        assertTrue(insertedRows.isPresent());
 +        assertEquals(2, insertedRows.get().intValue());
 +        
 +        final Optional<Iterable<Object>> generatedKeys = updateSummary.getGeneratedKeys();
 +        assertTrue(generatedKeys.isPresent());
 +        assertEquals("[1, 2]", generatedKeys.get().toString());
 +        
 +    }
++
      public void testBlob() throws Exception {
          if (!isConfigured()) {
              return;
diff --cc pom.xml
Simple merge
Simple merge