You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@polygene.apache.org by pa...@apache.org on 2017/07/26 19:06:52 UTC

[1/2] polygene-java git commit: Revert "Remove SQL Support Sample as it depends on indexing-sql"

Repository: polygene-java
Updated Branches:
  refs/heads/develop 42b3d3358 -> 8ab03799a


Revert "Remove SQL Support Sample as it depends on indexing-sql"

This reverts commit c33ef71f7c3a3d08d15b3492f706d82876798454.


Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/1cc2de9f
Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/1cc2de9f
Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/1cc2de9f

Branch: refs/heads/develop
Commit: 1cc2de9f9b0fc9a0d69aa172a69e3983f21ab63b
Parents: 42b3d33
Author: Paul Merlin <pa...@apache.org>
Authored: Wed Jul 26 21:03:48 2017 +0200
Committer: Paul Merlin <pa...@apache.org>
Committed: Wed Jul 26 21:03:48 2017 +0200

----------------------------------------------------------------------
 .../entitystore-sqlkv/src/docs/es-sqlkv.txt     |   3 +
 extensions/indexing-sql/src/docs/index-sql.txt  |   3 +
 libraries/sql/src/docs/sql.txt                  |   3 +
 manual/src/docs/website/samples.txt             |  31 ++++
 samples/sql-support/build.gradle                |  46 ++++++
 .../sample/sqlsupport/AppAssembler.java         | 111 +++++++++++++
 .../apache/polygene/sample/sqlsupport/Main.java | 160 +++++++++++++++++++
 .../sample/sqlsupport/PretextEntity.java        |  29 ++++
 .../resources/entitystore-postgresql.properties |  22 +++
 .../src/main/resources/indexing-sql.properties  |  22 +++
 .../postgresql-es-datasource.properties         |  25 +++
 .../postgresql-index-datasource.properties      |  25 +++
 settings.gradle                                 |   1 +
 13 files changed, 481 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/polygene-java/blob/1cc2de9f/extensions/entitystore-sqlkv/src/docs/es-sqlkv.txt
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sqlkv/src/docs/es-sqlkv.txt b/extensions/entitystore-sqlkv/src/docs/es-sqlkv.txt
index 9e1cde5..f36e39d 100644
--- a/extensions/entitystore-sqlkv/src/docs/es-sqlkv.txt
+++ b/extensions/entitystore-sqlkv/src/docs/es-sqlkv.txt
@@ -32,6 +32,9 @@ get <<library-circuitbreaker,Circuit Breaker>> and <<library-jmx, JMX>> integrat
 
 The database schema is managed using <<library-sql-liquibase>>.
 
+TIP: See the <<sample-sql-support>> that demonstrate combined use of <<library-sql>>, <<extension-es-sql>> and
+<<extension-indexing-sql>>.
+
 The following SQL databases are supported:
 
 - http://www.postgresql.org/[PostgreSQL]

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/1cc2de9f/extensions/indexing-sql/src/docs/index-sql.txt
----------------------------------------------------------------------
diff --git a/extensions/indexing-sql/src/docs/index-sql.txt b/extensions/indexing-sql/src/docs/index-sql.txt
index 1bb1b3c..aa9f56d 100644
--- a/extensions/indexing-sql/src/docs/index-sql.txt
+++ b/extensions/indexing-sql/src/docs/index-sql.txt
@@ -28,6 +28,9 @@ source=extensions/indexing-sql/dev-status.xml
 This extension fully leverage the <<library-sql>> meaning that you must use it to assemble your DataSource and that you
 get <<library-circuitbreaker,Circuit Breaker>> and <<library-jmx, JMX>> integration for free.
 
+TIP: See the <<sample-sql-support>> that demonstrate combined use of <<library-sql>>, <<extension-es-sqlkv>> and
+<<extension-indexing-sql>>.
+
 The following SQL databases are supported:
 
 - http://www.postgresql.org/[PostgreSQL]

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/1cc2de9f/libraries/sql/src/docs/sql.txt
----------------------------------------------------------------------
diff --git a/libraries/sql/src/docs/sql.txt b/libraries/sql/src/docs/sql.txt
index 08f9e75..4ffea6b 100644
--- a/libraries/sql/src/docs/sql.txt
+++ b/libraries/sql/src/docs/sql.txt
@@ -31,6 +31,9 @@ The SQL Library provides facilities for working with SQL databases.
 The center piece is the DataSource support that comes with
 <<library-circuitbreaker>> and <<library-jmx>> support.
 
+TIP: See the <<sample-sql-support>> that demonstrate combined use of <<library-sql>>, <<extension-es-sqlkv>> and
+<<extension-indexing-sql>>.
+
 Moreover, supplementary libraries helps dealing with different connection pool implementations and schema migrations.
 None of theses libraries depends on an actual JDBC driver, you are free to use the one that suits your needs.
 

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/1cc2de9f/manual/src/docs/website/samples.txt
----------------------------------------------------------------------
diff --git a/manual/src/docs/website/samples.txt b/manual/src/docs/website/samples.txt
index 18e672a..31232eb 100644
--- a/manual/src/docs/website/samples.txt
+++ b/manual/src/docs/website/samples.txt
@@ -60,6 +60,37 @@ https://github.com/apache/polygene-java/tree/develop/samples/rental[Browse Sourc
 //
 // https://github.com/apache/polygene-java/tree/develop/samples/scala[Browse Source]
 
+[[sample-sql-support,SQL Support Sample]]
+== SQL Support Sample ==
+
+NOTE: This sample use PostgreSQL and drop all of its data once run in order to be runnable multiple times.
+
+Sample of how to fully use Polygene™ SQL support : <<library-sql>>, <<extension-es-sqlkv>> and <<extension-indexing-sql>>.
+
+https://github.com/apache/polygene-java/tree/develop/samples/sql-support[Browse Source]
+
+Here are the steps needed to setup the database using the `psql` utility command:
+
+[source,bash]
+----
+user@host $ psql postgres
+postgres=# CREATE USER jdbc_test_login WITH PASSWORD 'password';
+CREATE ROLE
+postgres=# CREATE DATABASE jdbc_test_db;
+CREATE DATABASE
+postgres=# GRANT ALL PRIVILEGES ON DATABASE jdbc_test_db TO jdbc_test_login;
+GRANT
+postgres=# \q
+user@host $  psql -d jdbc_test_db</strong>
+postgres=# CREATE EXTENSION ltree;
+CREATE EXTENSION
+postgres=# \q
+user@host $
+----
+
+From the sources you can run the `runSqlSupportSample` Gradle task to run the example.
+See <<build-system>> if you need some guidance.
+
 [[sample-swing,Swing Bindings Sample]]
 == Swing Bindings Sample ==
 

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/1cc2de9f/samples/sql-support/build.gradle
----------------------------------------------------------------------
diff --git a/samples/sql-support/build.gradle b/samples/sql-support/build.gradle
new file mode 100644
index 0000000..19acd12
--- /dev/null
+++ b/samples/sql-support/build.gradle
@@ -0,0 +1,46 @@
+/*
+ *  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.
+ *
+ *
+ */
+import org.apache.polygene.gradle.TaskGroups
+
+apply plugin: 'polygene-sample'
+
+description = "SQL Support Sample."
+
+jar { manifest { name = "Apache Polygene™ Sample - SQL Support" } }
+
+dependencies {
+
+  implementation polygene.core.bootstrap
+  implementation polygene.library( 'sql-dbcp' )
+  implementation polygene.extension( 'entitystore-preferences' )
+  implementation polygene.extension( 'entitystore-sqlkv' )
+  implementation polygene.extension( 'indexing-sql' )
+
+  runtimeOnly polygene.core.runtime
+  runtimeOnly libraries.postgres
+  runtimeOnly libraries.logback
+}
+
+task( runSqlSupportSample, dependsOn: 'classes', type: JavaExec ) {
+  group = TaskGroups.SAMPLES
+  description = "Runs $project.name sample."
+  main = 'org.apache.polygene.sample.sqlsupport.Main'
+  classpath = sourceSets.main.runtimeClasspath
+}

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/1cc2de9f/samples/sql-support/src/main/java/org/apache/polygene/sample/sqlsupport/AppAssembler.java
----------------------------------------------------------------------
diff --git a/samples/sql-support/src/main/java/org/apache/polygene/sample/sqlsupport/AppAssembler.java b/samples/sql-support/src/main/java/org/apache/polygene/sample/sqlsupport/AppAssembler.java
new file mode 100644
index 0000000..716c954
--- /dev/null
+++ b/samples/sql-support/src/main/java/org/apache/polygene/sample/sqlsupport/AppAssembler.java
@@ -0,0 +1,111 @@
+/*
+ *  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.
+ *
+ *
+ */
+package org.apache.polygene.sample.sqlsupport;
+
+import org.apache.polygene.api.common.Visibility;
+import org.apache.polygene.bootstrap.ApplicationAssembler;
+import org.apache.polygene.bootstrap.ApplicationAssembly;
+import org.apache.polygene.bootstrap.ApplicationAssemblyFactory;
+import org.apache.polygene.bootstrap.LayerAssembly;
+import org.apache.polygene.bootstrap.ModuleAssembly;
+import org.apache.polygene.entitystore.memory.MemoryEntityStoreService;
+import org.apache.polygene.entitystore.sql.assembly.PostgreSQLEntityStoreAssembler;
+import org.apache.polygene.index.sql.assembly.PostgreSQLIndexQueryAssembler;
+import org.apache.polygene.library.sql.assembly.DataSourceAssembler;
+import org.apache.polygene.library.sql.datasource.DataSources;
+import org.apache.polygene.library.sql.dbcp.DBCPDataSourceServiceAssembler;
+
+/**
+ * Assemble the Application.
+ *
+ * Use SQL EntityStore and SQL Index/Query for Persistence using PostgreSQL.
+ * EntityStore and Index/Query use different DataSource in order to allow splitting the two in two servers/databases.
+ */
+public class AppAssembler
+    implements ApplicationAssembler
+{
+
+    @Override
+    public ApplicationAssembly assemble( ApplicationAssemblyFactory applicationFactory )
+    {
+        ApplicationAssembly appAss = applicationFactory.newApplicationAssembly();
+        appAss.setName( "SQL Support Sample" );
+
+        // Config
+        LayerAssembly configLayer = appAss.layer( "config" );
+        ModuleAssembly configModule = configLayer.module( "config" );
+        {
+            configModule.services( MemoryEntityStoreService.class ).
+                visibleIn( Visibility.module );
+            // Use a PreferenceEntityStore instead if you want the configuration to be persistent
+            // new PreferenceEntityStoreAssembler( Visibility.module ).assemble( configModule );
+        }
+
+        // Infra
+        LayerAssembly infraLayer = appAss.layer( "infra" );
+        ModuleAssembly persistenceModule = infraLayer.module( "persistence" );
+        {
+            // SQL DataSource Service
+            String dataSourceServiceIdentity = "postgresql-datasource-service";
+            new DBCPDataSourceServiceAssembler().
+                identifiedBy( dataSourceServiceIdentity ).
+                visibleIn( Visibility.module ).
+                withConfig( configModule, Visibility.application ).
+                assemble( persistenceModule );
+
+            // SQL EntityStore DataSource and Service
+            new DataSourceAssembler().
+                withDataSourceServiceIdentity( dataSourceServiceIdentity ).
+                identifiedBy( "postgresql-es-datasource" ).
+                visibleIn( Visibility.module ).
+                withCircuitBreaker( DataSources.newDataSourceCircuitBreaker() ).assemble( persistenceModule );
+            new PostgreSQLEntityStoreAssembler().
+                visibleIn( Visibility.application ).
+                withConfig( configModule, Visibility.application ).
+                assemble( persistenceModule );
+
+            // SQL Index/Query DataSource and Service
+            new DataSourceAssembler().
+                withDataSourceServiceIdentity( dataSourceServiceIdentity ).
+                identifiedBy( "postgresql-index-datasource" ).
+                visibleIn( Visibility.module ).
+                withCircuitBreaker().
+                assemble( persistenceModule );
+            new PostgreSQLIndexQueryAssembler().
+                visibleIn( Visibility.application ).
+                withConfig( configModule, Visibility.application ).
+                assemble( persistenceModule );
+        }
+
+        // App
+        LayerAssembly appLayer = appAss.layer( "app" );
+        ModuleAssembly domainModule = appLayer.module( "domain" );
+        {
+            domainModule.entities( PretextEntity.class );
+        }
+
+        // Uses
+        infraLayer.uses( configLayer );
+        appLayer.uses( infraLayer );
+
+        return appAss;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/1cc2de9f/samples/sql-support/src/main/java/org/apache/polygene/sample/sqlsupport/Main.java
----------------------------------------------------------------------
diff --git a/samples/sql-support/src/main/java/org/apache/polygene/sample/sqlsupport/Main.java b/samples/sql-support/src/main/java/org/apache/polygene/sample/sqlsupport/Main.java
new file mode 100644
index 0000000..5a96f31
--- /dev/null
+++ b/samples/sql-support/src/main/java/org/apache/polygene/sample/sqlsupport/Main.java
@@ -0,0 +1,160 @@
+/*
+ *  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.
+ *
+ *
+ */
+package org.apache.polygene.sample.sqlsupport;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.sql.Statement;
+import javax.sql.DataSource;
+import org.apache.polygene.api.entity.EntityBuilder;
+import org.apache.polygene.api.query.Query;
+import org.apache.polygene.api.query.QueryBuilder;
+import org.apache.polygene.api.structure.Application;
+import org.apache.polygene.api.structure.Module;
+import org.apache.polygene.api.unitofwork.UnitOfWork;
+import org.apache.polygene.bootstrap.Energy4Java;
+import org.apache.polygene.entitystore.sql.assembly.PostgreSQLEntityStoreAssembler;
+import org.apache.polygene.index.sql.assembly.PostgreSQLIndexQueryAssembler;
+import org.apache.polygene.library.sql.common.SQLConfiguration;
+import org.apache.polygene.library.sql.common.SQLUtil;
+
+import static org.apache.polygene.api.query.QueryExpressions.eq;
+import static org.apache.polygene.api.query.QueryExpressions.templateFor;
+
+/**
+ * SQL Support Sample Main Class.
+ * <p><strong>psql postgres</strong></p>
+ * <p>CREATE USER jdbc_test_login WITH PASSWORD 'password';</p>
+ * <p>CREATE DATABASE jdbc_test_db;</p>
+ * <p>GRANT ALL PRIVILEGES ON DATABASE jdbc_test_db TO jdbc_test_login;</p>
+ * <p><strong>psql -d jdbc_test_db</strong></p>
+ * <p>CREATE EXTENSION ltree;</p>
+ */
+public class Main
+{
+
+    public static void main( String[] args )
+            throws Exception
+    {
+        final Application application = new Energy4Java().newApplication( new AppAssembler() );
+        application.activate();
+        Runtime.getRuntime().addShutdownHook( new Thread( new Runnable()
+        {
+            @Override
+            @SuppressWarnings( "CallToThreadDumpStack" )
+            public void run()
+            {
+                try {
+                    application.passivate();
+                } catch ( Exception ex ) {
+                    System.err.println( "Unable to passivate Polygene application!" );
+                    ex.printStackTrace();
+                }
+            }
+
+        } ) );
+        Module domainModule = application.findModule( "app", "domain" );
+
+        int exitStatus = 0;
+
+        try {
+
+            UnitOfWork uow = domainModule.unitOfWorkFactory().newUnitOfWork();
+            EntityBuilder<PretextEntity> builder = uow.newEntityBuilder( PretextEntity.class );
+            PretextEntity pretext = builder.instance();
+            pretext.reason().set( "Testing purpose" );
+            builder.newInstance();
+            uow.complete();
+
+            uow = domainModule.unitOfWorkFactory().newUnitOfWork();
+            QueryBuilder<PretextEntity> queryBuilder = domainModule.newQueryBuilder( PretextEntity.class );
+            queryBuilder = queryBuilder.where( eq( templateFor( PretextEntity.class ).reason(), "Testing purpose" ) );
+            Query<PretextEntity> query = uow.newQuery( queryBuilder );
+            pretext = query.find();
+            if ( pretext == null ) {
+                System.err.println( "ERROR: Unable to find pretext!" );
+                exitStatus = -1;
+            } else {
+                System.out.println( "SUCCESS: Found Pretext with reason: " + pretext.reason().get() );
+            }
+            uow.discard();
+
+        } finally {
+            deleteData( application.findModule( "infra", "persistence" ) );
+        }
+
+        System.exit( exitStatus );
+    }
+
+    /**
+     * Completely delete data so the sample can be run multiple times.
+     */
+    private static void deleteData( Module persistenceModule )
+            throws SQLException
+    {
+        // EntityStore Data
+        {
+            UnitOfWork uow = persistenceModule.unitOfWorkFactory().newUnitOfWork();
+            try {
+                SQLConfiguration config = uow.get( SQLConfiguration.class, PostgreSQLEntityStoreAssembler.DEFAULT_ENTITYSTORE_IDENTITY );
+                Connection connection = persistenceModule.findService( DataSource.class ).get().getConnection();
+                connection.setAutoCommit( false );
+                connection.setReadOnly( false );
+                String schemaName = config.schemaName().get();
+
+                Statement stmt = null;
+                try {
+                    stmt = connection.createStatement();
+                    stmt.execute( "DROP SCHEMA " + schemaName + " CASCADE" );
+                    connection.commit();
+                } finally {
+                    SQLUtil.closeQuietly( stmt );
+                }
+            } finally {
+                uow.discard();
+            }
+        }
+
+        // Indexing Data
+        {
+            UnitOfWork uow = persistenceModule.unitOfWorkFactory().newUnitOfWork();
+            try {
+                SQLConfiguration config = uow.get( SQLConfiguration.class, PostgreSQLIndexQueryAssembler.DEFAULT_IDENTITY  );
+                Connection connection = persistenceModule.findService( DataSource.class ).get().getConnection();
+                connection.setAutoCommit( false );
+                connection.setReadOnly( false );
+                String schemaName = config.schemaName().get();
+
+                Statement stmt = null;
+                try {
+                    stmt = connection.createStatement();
+                    stmt.execute( "DROP SCHEMA " + schemaName + " CASCADE" );
+                    connection.commit();
+                } finally {
+                    SQLUtil.closeQuietly( stmt );
+                    SQLUtil.closeQuietly( connection );
+                }
+            } finally {
+                uow.discard();
+            }
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/1cc2de9f/samples/sql-support/src/main/java/org/apache/polygene/sample/sqlsupport/PretextEntity.java
----------------------------------------------------------------------
diff --git a/samples/sql-support/src/main/java/org/apache/polygene/sample/sqlsupport/PretextEntity.java b/samples/sql-support/src/main/java/org/apache/polygene/sample/sqlsupport/PretextEntity.java
new file mode 100644
index 0000000..f487a57
--- /dev/null
+++ b/samples/sql-support/src/main/java/org/apache/polygene/sample/sqlsupport/PretextEntity.java
@@ -0,0 +1,29 @@
+/*
+ *  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.
+ *
+ *
+ */
+package org.apache.polygene.sample.sqlsupport;
+
+import org.apache.polygene.api.property.Property;
+
+public interface PretextEntity
+{
+
+    Property<String> reason();
+
+}

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/1cc2de9f/samples/sql-support/src/main/resources/entitystore-postgresql.properties
----------------------------------------------------------------------
diff --git a/samples/sql-support/src/main/resources/entitystore-postgresql.properties b/samples/sql-support/src/main/resources/entitystore-postgresql.properties
new file mode 100644
index 0000000..48cd452
--- /dev/null
+++ b/samples/sql-support/src/main/resources/entitystore-postgresql.properties
@@ -0,0 +1,22 @@
+#
+#  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.
+#
+#
+#
+
+
+schemaName=sql_sample_entitystore

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/1cc2de9f/samples/sql-support/src/main/resources/indexing-sql.properties
----------------------------------------------------------------------
diff --git a/samples/sql-support/src/main/resources/indexing-sql.properties b/samples/sql-support/src/main/resources/indexing-sql.properties
new file mode 100644
index 0000000..700b84f
--- /dev/null
+++ b/samples/sql-support/src/main/resources/indexing-sql.properties
@@ -0,0 +1,22 @@
+#
+#  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.
+#
+#
+#
+
+
+schemaName=sql_sample_indexing

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/1cc2de9f/samples/sql-support/src/main/resources/postgresql-es-datasource.properties
----------------------------------------------------------------------
diff --git a/samples/sql-support/src/main/resources/postgresql-es-datasource.properties b/samples/sql-support/src/main/resources/postgresql-es-datasource.properties
new file mode 100644
index 0000000..ea16c45
--- /dev/null
+++ b/samples/sql-support/src/main/resources/postgresql-es-datasource.properties
@@ -0,0 +1,25 @@
+#
+#  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.
+#
+#
+#
+
+enabled=true
+url=jdbc:postgresql://localhost:5432/jdbc_test_db
+driver=org.postgresql.Driver
+username=jdbc_test_login
+password=password

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/1cc2de9f/samples/sql-support/src/main/resources/postgresql-index-datasource.properties
----------------------------------------------------------------------
diff --git a/samples/sql-support/src/main/resources/postgresql-index-datasource.properties b/samples/sql-support/src/main/resources/postgresql-index-datasource.properties
new file mode 100644
index 0000000..ea16c45
--- /dev/null
+++ b/samples/sql-support/src/main/resources/postgresql-index-datasource.properties
@@ -0,0 +1,25 @@
+#
+#  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.
+#
+#
+#
+
+enabled=true
+url=jdbc:postgresql://localhost:5432/jdbc_test_db
+driver=org.postgresql.Driver
+username=jdbc_test_login
+password=password

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/1cc2de9f/settings.gradle
----------------------------------------------------------------------
diff --git a/settings.gradle b/settings.gradle
index 7cb671f..92e3bf0 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -96,6 +96,7 @@ include 'core:api',
         'samples:dci',
         'samples:forum',
         'samples:rental',
+        'samples:sql-support',
         'samples:swing'
 
 include 'internals:testsupport-internal'


[2/2] polygene-java git commit: Upgrade Gradle to 4.0.2

Posted by pa...@apache.org.
Upgrade Gradle to 4.0.2


Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/8ab03799
Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/8ab03799
Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/8ab03799

Branch: refs/heads/develop
Commit: 8ab03799aca61dc7d5fb37bd0c03373b6e03b9c5
Parents: 1cc2de9
Author: Paul Merlin <pa...@apache.org>
Authored: Wed Jul 26 21:05:05 2017 +0200
Committer: Paul Merlin <pa...@apache.org>
Committed: Wed Jul 26 21:05:05 2017 +0200

----------------------------------------------------------------------
 dependencies.gradle                      |   2 +-
 gradle/wrapper/gradle-wrapper.jar        | Bin 54712 -> 54712 bytes
 gradle/wrapper/gradle-wrapper.properties |   2 +-
 3 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8ab03799/dependencies.gradle
----------------------------------------------------------------------
diff --git a/dependencies.gradle b/dependencies.gradle
index b6446ad..f803793 100644
--- a/dependencies.gradle
+++ b/dependencies.gradle
@@ -20,7 +20,7 @@ import org.apache.polygene.gradle.dependencies.DependenciesDeclarationExtension
 def dependencies = extensions.getByType( DependenciesDeclarationExtension )
 
 // Gradle version
-dependencies.gradleVersion = '4.0.1'
+dependencies.gradleVersion = '4.0.2'
 
 // Remote repositories
 dependencies.repositoriesUrls << [

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8ab03799/gradle/wrapper/gradle-wrapper.jar
----------------------------------------------------------------------
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index e72a4d1..567bb9c 100644
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8ab03799/gradle/wrapper/gradle-wrapper.properties
----------------------------------------------------------------------
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index e7e0968..4b0c3d0 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -20,4 +20,4 @@ distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.0.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.0.2-all.zip