cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Schönfisch, Jörg <joerg.schoenfi...@softplant.de>
Subject AW: ThrowOnPartialOrCreateSchemaStrategy, DbEntities with schema, and missing tables
Date Fri, 23 Dec 2011 08:49:34 GMT
CAY-1226 might also be related to this.


-----Ursprüngliche Nachricht-----
Von: Schönfisch, Jörg [mailto:joerg.schoenfisch@softplant.de] 
Gesendet: Freitag, 23. Dezember 2011 09:46
An: dev@cayenne.apache.org
Betreff: ThrowOnPartialOrCreateSchemaStrategy, DbEntities with schema, and missing tables

Hi everybody,

I'm using a ThrowOnPartialOrCreateSchemaStrategy and I ran into the problem that my tables
are not generated if I specify a schema for the DbEntities. SchemaAnalyzer.compareTables only
checks if the schema exists and doesn't verify if it actually contains any tables. I'm using
the latest trunk (rev 1222604) and Postgres 8.3. The following patch fixes the problem for
me. Should I raise an issue in JIRA for this?

Cheers,
Joerg



Index: SchemaAnalyzer.java
===================================================================
--- SchemaAnalyzer.java	(revision 1222604)
+++ SchemaAnalyzer.java	(working copy)
@@ -119,7 +119,12 @@
 
             if (schema != null) {
                 if (schemaNameMap.get(schema) != null) {
-
+                    Collection<String> names = schemaNameMap.get(schema);
+                    if (names.contains(name)) {
+                        mapTableInDB.put(name, schema);
+                    } else {
+                        tableNoInDB.add(name);
+                    }
                 }
                 else {
                     isIncluded = false;

Mime
View raw message