You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@polygene.apache.org by ni...@apache.org on 2017/10/28 01:42:28 UTC
polygene-java git commit: Fixing a bug in table name generation,
as entities and types tables were hardcoded,
but they are not. Downgraded to Gradle 4.0.2 because a warning says that is
the only version supported.
Repository: polygene-java
Updated Branches:
refs/heads/develop db90b19ca -> 8fb6d58ab
Fixing a bug in table name generation, as entities and types tables were hardcoded, but they are not.
Downgraded to Gradle 4.0.2 because a warning says that is the only version supported.
Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/8fb6d58a
Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/8fb6d58a
Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/8fb6d58a
Branch: refs/heads/develop
Commit: 8fb6d58ab36c15b830cd4389d7629acf49204fd7
Parents: db90b19
Author: niclas <ni...@hedhman.org>
Authored: Sat Oct 28 09:42:18 2017 +0800
Committer: niclas <ni...@hedhman.org>
Committed: Sat Oct 28 09:42:18 2017 +0800
----------------------------------------------------------------------
.../java/org/apache/polygene/entitystore/sql/SqlTable.java | 5 ++---
.../java/org/apache/polygene/entitystore/sql/TypesTable.java | 7 +++++--
2 files changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8fb6d58a/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/SqlTable.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/SqlTable.java b/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/SqlTable.java
index 3652ada..4590028 100644
--- a/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/SqlTable.java
+++ b/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/SqlTable.java
@@ -193,15 +193,14 @@ public interface SqlTable extends ServiceActivation
{
SqlEntityStoreConfiguration config = this.configuration.get();
SQLDialect dialect = getSqlDialect( config );
- Settings settings = serviceDescriptor
- .metaInfo( Settings.class );
+ Settings settings = serviceDescriptor.metaInfo( Settings.class );
String typesTableName = config.typesTableName().get();
String entitiesTableName = config.entitiesTableName().get();
dsl = tbf.newTransient( JooqDslContext.class, settings, dialect );
- types = new TypesTable( dsl, dialect, typesTableName );
+ types = new TypesTable( dsl, dialect, typesTableName, config );
entitiesTable = new EntitiesTable( dsl, types, application.version(), entitiesTableName, serialization );
if( config.createIfMissing().get() )
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8fb6d58a/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/TypesTable.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/TypesTable.java b/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/TypesTable.java
index c2546f1..15626ad 100644
--- a/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/TypesTable.java
+++ b/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/TypesTable.java
@@ -45,15 +45,18 @@ public class TypesTable
private final Table<Record> typesTable;
private final SQLDialect dialect;
+ private final SqlEntityStoreConfiguration config;
private final JooqDslContext dsl;
TypesTable( JooqDslContext dsl,
SQLDialect dialect,
- String typesTablesName
+ String typesTablesName,
+ SqlEntityStoreConfiguration config
)
{
this.dialect = dialect;
+ this.config = config;
typesTable = dsl.tableOf( typesTablesName );
this.dsl = dsl;
}
@@ -148,7 +151,7 @@ public class TypesTable
private boolean checkForTableNamed( String tableName )
{
- if( tableName.equalsIgnoreCase( "entities" ) || tableName.equalsIgnoreCase( "types" ))
+ if( tableName.equalsIgnoreCase( config.entitiesTableName().get() ) || tableName.equalsIgnoreCase( config.typesTableName().get() ))
{
return true;
}