Return-Path: X-Original-To: apmail-openjpa-users-archive@minotaur.apache.org Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2BE24997E for ; Thu, 21 Jun 2012 17:25:58 +0000 (UTC) Received: (qmail 64068 invoked by uid 500); 21 Jun 2012 17:25:58 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 64031 invoked by uid 500); 21 Jun 2012 17:25:57 -0000 Mailing-List: contact users-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openjpa.apache.org Delivered-To: mailing list users@openjpa.apache.org Received: (qmail 64023 invoked by uid 99); 21 Jun 2012 17:25:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jun 2012 17:25:57 +0000 X-ASF-Spam-Status: No, hits=4.2 required=5.0 tests=HTML_MESSAGE,SPF_NEUTRAL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: 216.139.236.26 is neither permitted nor denied by domain of alexey.v.romanov@gmail.com) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jun 2012 17:25:49 +0000 Received: from jim.nabble.com ([192.168.236.80]) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1Shl8K-000778-F0 for users@openjpa.apache.org; Thu, 21 Jun 2012 10:25:28 -0700 Date: Thu, 21 Jun 2012 10:25:18 -0700 (PDT) From: Alexey Romanov To: users@openjpa.apache.org Message-ID: In-Reply-To: References: Subject: Re: Change of MappingDefaults breaks OPENJPA_SEQUENCE_TABLE MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_2232515_24178463.1340299518067" ------=_Part_2232515_24178463.1340299518067 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Option 1 is probably the more suitable one. My current solution preserves the case, but I don't actually need that; lowercase everywhere is good enough. Thanks! Yours, Alexey Romanov On Thu, Jun 21, 2012 at 7:06 PM, Dianne Richards [via OpenJPA] wrote: > ok - I didn't catch it earlier that you wanted lowercase. You actually ha= ve > 2 options: > > 1 - You can call toLower() on your validName. Here's the revised method. > > protected void correctName(Table table, Column col) { > =C2=A0 =C2=A0 =C2=A0 =C2=A0 DBIdentifier name =3D > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 DBIdentifier.newColumn(col.getI= dentifier().getName(), false); > =C2=A0 =C2=A0 =C2=A0 =C2=A0 DBIdentifier correctedName =3D > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 DBIdentifier.newColumn(addUnder= scores(name.getName())); > =C2=A0 =C2=A0 =C2=A0 =C2=A0 DBIdentifier validName =3D dict.getValidColum= nName(correctedName, > table); > =C2=A0 =C2=A0 =C2=A0 =C2=A0 DBIdentifier validNameLower =3D validName.toL= ower(validName); > =C2=A0 =C2=A0 =C2=A0 =C2=A0 col.setIdentifier(validNameLower); > =C2=A0 =C2=A0 =C2=A0 =C2=A0 table.addCorrectedColumnName(validNameLower, = true); > =C2=A0 =C2=A0 } > > 2 - You can actually override DBIdentifierUtilImpl and specify the new > class with the jdbc.IdentifierUtil property. You can then have > makeIdentifierValid() do what you want. > > Note: Even though your SQL has lower case names, in many DBs the name wil= l > be set to uppercase. The only way to preserve case is to delimit the name= s. > > Dianne > > On Wed, Jun 20, 2012 at 2:39 PM, Alexey Romanov > <[hidden email]>wrote: > >> Yes, that was one of things I've tried, but I much prefer lowercase >> for identifiers in SQL to make it more readable :) And I've decided >> that complicating my MappingDefaults for it slightly is a good >> tradeoff. >> >> One more complication was that in the OSGi setting I had to add a >> fragment to the OpenJPA bundle to let it load my MappingDefaults class >> and presumably the same would apply to other classes specified by >> plugin strings. Perhaps OpenJPA bundle headers should include >> `DynamicImport-Package: *`? >> >> Yours, Alexey Romanov >> >> >> On Wed, Jun 20, 2012 at 9:37 PM, Dianne Richards [via OpenJPA] >> <[hidden email]> wrote: >> > ok - Here's what I think you should do. First, set the delimit value t= o >> > "false" in the newColumn() call, as I indicated in a previous post. >> > Then, >> > switch the statements for assigning validName and correctedName. Here'= s >> an >> > example: >> > >> > public class ImprovedMappingDefaults extends PersistenceMappingDefault= s >> > { >> > =C2=A0 =C2=A0 @Override >> > =C2=A0 =C2=A0 protected void correctName(Table table, Column col) { >> > =C2=A0 =C2=A0 =C2=A0 DBIdentifier name =3D >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 DBIdentifier.newColumn(col.getIdent= ifier().getName(), false); >> > =C2=A0 =C2=A0 =C2=A0 DBIdentifier correctedName =3D >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 DBIdentifier.newColum= n(addUnderscores(name.getName())); >> > =C2=A0 =C2=A0 =C2=A0 DBIdentifier validName =3D dict.getValidColumnNam= e(correctedName, >> > table); >> > =C2=A0 =C2=A0 =C2=A0 col.setIdentifier(validName); >> > =C2=A0 =C2=A0 =C2=A0 table.addCorrectedColumnName(validName, true); >> > =C2=A0 } >> > >> > I think this change will at least allow the table to be created as you >> > desire. >> > >> > Here's the SQL for my test: >> > CREATE TABLE object_classes -- EntityWithUnderscore >> > =C2=A0 =C2=A0 (ID_COL INTEGER NOT NULL, NAME VARCHAR(255) NOT NULL, NA= ME_COL >> > VARCHAR(255), PRIMARY KEY (ID_COL), CONSTRAINT U_BJCTSSS_NAME UNIQUE >> (NAME)) >> > >> > I haven't tried any queries. I will if you run into later problems. >> > >> > Dianne >> > >> > On Wed, Jun 20, 2012 at 12:04 PM, Dianne Richards <[hidden email]>wrot= e: >> > >> >> Oops - I just looked more closely at the output, and it's not what yo= u >> >> want. I'll keep going. >> >> >> >> Dianne >> >> >> >> >> >> On Wed, Jun 20, 2012 at 11:53 AM, Dianne Richards <[hidden >> >> email]>wrote: >> >> >> >>> Hi Alexey - I was able to reproduce this problem with a simple test >> case >> >>> and debug it. I think you can get what you want by changing the >> following >> >>> line in your ImprovedMappingDefaults: >> >>> >> >>> DBIdentifier.newColumn(col.getIdentifier().getName(), true); >> >>> >> >>> Change the "true" to "false". What's happening is the true says to >> >>> delimit the name, which has a rippling effect. I don't think you wan= t >> >>> this. >> >>> >> >>> It works on my simple test, so hopefully it will work for you. >> >>> >> >>> Dianne >> >>> >> >>> >> >>> On Sat, Jun 9, 2012 at 2:11 AM, Alexey Romanov < >> >>> [hidden email]> wrote: >> >>> >> >>>> I've tried to change mapping defaults to use lowercase underscore >> column >> >>>> names: >> >>>> >> >>>> package ru.focusmedia.odp.server.datastore.jpa.impl; >> >>>> >> >>>> import org.apache.openjpa.jdbc.identifier.DBIdentifier; >> >>>> import org.apache.openjpa.jdbc.schema.Column; >> >>>> import org.apache.openjpa.jdbc.schema.Table; >> >>>> import >> >>>> org.apache.openjpa.persistence.jdbc.PersistenceMappingDefaults; >> >>>> >> >>>> public class ImprovedMappingDefaults extends >> PersistenceMappingDefaults >> >>>> { >> >>>> =C2=A0 =C2=A0@Override >> >>>> =C2=A0 =C2=A0protected void correctName(Table table, Column col) { >> >>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0DBIdentifier name =3D >> >>>> DBIdentifier.newColumn(col.getIdentifier().getName(), true); >> >>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0DBIdentifier validName =3D dict.getValid= ColumnName(name, table); >> >>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0DBIdentifier correctedName =3D DBIdentif= ier >> >>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0.newColumn(a= ddUnderscores(validName.getName())); >> >>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0col.setIdentifier(correctedName); >> >>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0table.addCorrectedColumnName(correctedNa= me, true); >> >>>> =C2=A0 =C2=A0} >> >>>> >> >>>> =C2=A0 =C2=A0// taken from Hibernate's ImprovedNamingStrategy >> >>>> =C2=A0 =C2=A0private static String addUnderscores(String name) { >> >>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0StringBuffer buf =3D new StringBuffer(na= me.replace('.', '_')); >> >>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0for (int i =3D 1; i < buf.length() - 1; = i++) { >> >>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (Character.isLowerCase(= buf.charAt(i - 1)) >> >>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0&& Character.isUpperCase(buf.charAt(i)) >> >>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0&& Character.isLowerCase(buf.charAt(i + 1))) { >> >>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0buf.insert(i= ++, '_'); >> >>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> >>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> >>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0return buf.toString().toLowerCase(); >> >>>> =C2=A0 =C2=A0} >> >>>> } >> >>>> >> >>>> and added >> >>>> >> >>>> > >>>> >> >>>> >> >>>> >> >> =C2=A0value=3D"ru.focusmedia.odp.server.datastore.jpa.impl.ImprovedMappi= ngDefaults"/> >> >>>> >> >>>> to persistence.xml. However, this produces the following error: >> >>>> >> >>>> org.apache.openjpa.persistence.PersistenceException: Table/View >> >>>> 'OPENJPA_SEQUENCE_TABLE' does not exist. {SELECT SEQUENCE_VALUE FRO= M >> >>>> OPENJPA_SEQUENCE_TABLE WHERE ID =3D ? FOR UPDATE WITH RR} [code=3D2= 0000, >> >>>> state=3D42X05] >> >>>> =C2=A0 =C2=A0at >> >>>> >> org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4918) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.= java:4878) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:13= 6) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:11= 0) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:62= ) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq.next(AbstractJDBCSeq.java= :66) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> >>>> org.apache.openjpa.util.ImplHelper.generateValue(ImplHelper.java:16= 0) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> org.apache.openjpa.util.ImplHelper.generateFieldValue(ImplHelper.java:14= 4) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.assignField(JDBCStoreMan= ager.java:756) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> org.apache.openjpa.util.ApplicationIds.assign(ApplicationIds.java:4= 93) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> org.apache.openjpa.util.ApplicationIds.assign(ApplicationIds.java:4= 69) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.assignObjectId(JDBCStore= Manager.java:740) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.apache.openjpa.kernel.DelegatingStoreManager.assignObjectId(Delegati= ngStoreManager.java:135) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.apache.openjpa.kernel.StateManagerImpl.assignObjectId(StateManagerIm= pl.java:612) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.apache.openjpa.kernel.StateManagerImpl.preFlush(StateManagerImpl.jav= a:2977) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> org.apache.openjpa.kernel.PNewState.beforeFlush(PNewState.java:40) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.apache.openjpa.kernel.StateManagerImpl.beforeFlush(StateManagerImpl.= java:1054) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> >>>> org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2112) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> >>>> org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:2072= ) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> >>>> org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1843) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> org.apache.openjpa.kernel.QueryImpl.isInMemory(QueryImpl.java:973) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at org.apache.openjpa.kernel.QueryImpl.execute(QueryIm= pl.java:853) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at org.apache.openjpa.kernel.QueryImpl.execute(QueryIm= pl.java:794) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:5= 42) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> >>>> org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:286= ) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:30= 2) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.apache.openjpa.persistence.QueryImpl.getSingleResult(QueryImpl.java:= 330) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> com.mysema.query.jpa.impl.AbstractJPAQuery.getSingleResult(AbstractJPAQu= ery.java:249) >> >>>> ~[querydsl-jpa-2.6.0.jar:na] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> com.mysema.query.jpa.impl.AbstractJPAQuery.uniqueResult(AbstractJPAQuery= .java:327) >> >>>> ~[querydsl-jpa-2.6.0.jar:na] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> com.mysema.query.jpa.impl.AbstractJPAQuery.uniqueResult(AbstractJPAQuery= .java:312) >> >>>> ~[querydsl-jpa-2.6.0.jar:na] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> ru.focusmedia.odp.server.datastore.jpa.repository.RepositoryImpl.getRole= ByName(RepositoryImpl.java:523) >> >>>> [classes/:na] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> ru.focusmedia.odp.server.datastore.jpa.repository.RepositoryImpl.access$= 4(RepositoryImpl.java:521) >> >>>> [classes/:na] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> ru.focusmedia.odp.server.datastore.jpa.repository.RepositoryImpl$14.call= (RepositoryImpl.java:572) >> >>>> [classes/:na] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> ru.focusmedia.odp.server.datastore.jpa.repository.RepositoryImpl$14.call= (RepositoryImpl.java:1) >> >>>> [classes/:na] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> ru.focusmedia.odp.server.datastore.jpa.repository.RepositoryImpl.transac= t(RepositoryImpl.java:705) >> >>>> [classes/:na] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> ru.focusmedia.odp.server.datastore.jpa.repository.RepositoryImpl.createU= ser(RepositoryImpl.java:568) >> >>>> [classes/:na] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> ru.focusmedia.odp.server.datastore.jpa.repository.RepositoryTest.userCan= BeCreated(RepositoryTest.java:158) >> >>>> [test-classes/:na] >> >>>> =C2=A0 =C2=A0at sun.reflect.NativeMethodAccessorImpl.invoke0(Native= Method) >> >>>> ~[na:1.6.0_31] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav= a:39) >> >>>> ~[na:1.6.0_31] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor= Impl.java:25) >> >>>> ~[na:1.6.0_31] >> >>>> =C2=A0 =C2=A0at java.lang.reflect.Method.invoke(Method.java:597) ~[= na:1.6.0_31] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMet= hod.java:45) >> >>>> [junit-4.10.jar:na] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallab= le.java:15) >> >>>> [junit-4.10.jar:na] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMetho= d.java:42) >> >>>> [junit-4.10.jar:na] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod= .java:20) >> >>>> [junit-4.10.jar:na] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.jav= a:28) >> >>>> [junit-4.10.jar:na] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:= 30) >> >>>> [junit-4.10.jar:na] >> >>>> =C2=A0 =C2=A0at org.junit.runners.ParentRunner.runLeaf(ParentRunner= .java:263) >> >>>> [junit-4.10.jar:na] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner= .java:68) >> >>>> [junit-4.10.jar:na] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner= .java:47) >> >>>> [junit-4.10.jar:na] >> >>>> =C2=A0 =C2=A0at org.junit.runners.ParentRunner$3.run(ParentRunner.j= ava:231) >> >>>> [junit-4.10.jar:na] >> >>>> =C2=A0 =C2=A0at org.junit.runners.ParentRunner$1.schedule(ParentRun= ner.java:60) >> >>>> [junit-4.10.jar:na] >> >>>> =C2=A0 =C2=A0at >> org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) >> >>>> [junit-4.10.jar:na] >> >>>> =C2=A0 =C2=A0at org.junit.runners.ParentRunner.access$000(ParentRun= ner.java:50) >> >>>> [junit-4.10.jar:na] >> >>>> =C2=A0 =C2=A0at >> >>>> org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) >> >>>> [junit-4.10.jar:na] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.jav= a:28) >> >>>> [junit-4.10.jar:na] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:= 30) >> >>>> [junit-4.10.jar:na] >> >>>> =C2=A0 =C2=A0at org.junit.runners.ParentRunner.run(ParentRunner.jav= a:300) >> >>>> [junit-4.10.jar:na] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4Tes= tReference.java:50) >> >>>> [.cp/:na] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.ja= va:38) >> >>>> [.cp/:na] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTe= stRunner.java:467) >> >>>> [.cp/:na] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTe= stRunner.java:683) >> >>>> [.cp/:na] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRun= ner.java:390) >> >>>> [.cp/:na] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRu= nner.java:197) >> >>>> [.cp/:na] >> >>>> Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: >> >>>> Table/View 'OPENJPA_SEQUENCE_TABLE' does not exist. {SELECT >> >>>> SEQUENCE_VALUE FROM OPENJPA_SEQUENCE_TABLE WHERE ID =3D ? FOR UPDAT= E >> >>>> WITH RR} [code=3D20000, state=3D42X05] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConne= ctionDecorator.java:247) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConne= ctionDecorator.java:227) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$000(Loggin= gConnectionDecorator.java:72) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection= .prepareStatement(LoggingConnectionDecorator.java:279) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.apache.openjpa.lib.jdbc.DelegatingConnection.prepareStatement(Delega= tingConnection.java:133) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.apache.openjpa.lib.jdbc.ConfiguringConnectionDecorator$ConfiguringCo= nnection.prepareStatement(ConfiguringConnectionDecorator.java:140) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.apache.openjpa.lib.jdbc.DelegatingConnection.prepareStatement(Delega= tingConnection.java:122) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> org.apache.openjpa.jdbc.sql.SQLBuffer.prepareStatement(SQLBuffer.java:44= 9) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> org.apache.openjpa.jdbc.sql.SQLBuffer.prepareStatement(SQLBuffer.java:42= 9) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> org.apache.openjpa.jdbc.sql.SQLBuffer.prepareStatement(SQLBuffer.java:41= 8) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.apache.openjpa.jdbc.kernel.TableJDBCSeq.prepareStatement(TableJDBCSe= q.java:807) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.apache.openjpa.jdbc.kernel.TableJDBCSeq.getSequence(TableJDBCSeq.jav= a:546) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.apache.openjpa.jdbc.kernel.TableJDBCSeq.setSequence(TableJDBCSeq.jav= a:588) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.apache.openjpa.jdbc.kernel.TableJDBCSeq$AllocateSequenceRunnable.run= (TableJDBCSeq.java:893) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.apache.openjpa.jdbc.kernel.TableJDBCSeq.allocateSequence(TableJDBCSe= q.java:455) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.apache.openjpa.jdbc.kernel.TableJDBCSeq.nextInternal(TableJDBCSeq.ja= va:300) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0at >> >>>> >> >>>> >> >> org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq.next(AbstractJDBCSeq.java= :60) >> >>>> ~[openjpa-2.2.0.jar:2.2.0] >> >>>> =C2=A0 =C2=A0... 58 common frames omitted >> >>>> >> >>>> before any tables are created. Googling says this may happen becaus= e >> >>>> SynchronizeMappings isn't set, but it is in my case: >> >>>> >> >>>> > >>>> =C2=A0 =C2=A0value=3D"buildSchema(ForeignKeys=3Dtrue)" /> >> >>>> > >>>> =C2=A0 =C2=A0value=3D"derby(NextSequenceQuery=3DVALUES NEXT VALUE F= OR {0})" /> >> >>>> >> >>>> How can I get this to work? >> >>>> >> >>>> Yours, Alexey Romanov >> >>>> >> >>> >> >>> >> >>> >> >>> -- >> >>> Thanks - Dianne >> >>> >> >> >> >> >> >> >> >> -- >> >> Thanks - Dianne >> >> >> > >> > >> > >> > -- >> > Thanks - Dianne >> > >> > >> > ________________________________ >> > If you reply to this email, your message will be added to the discussi= on >> > below: >> > >> >> http://openjpa.208410.n2.nabble.com/Change-of-MappingDefaults-breaks-OPE= NJPA-SEQUENCE-TABLE-tp7580246p7580349.html >> > To unsubscribe from Change of MappingDefaults breaks >> OPENJPA_SEQUENCE_TABLE, >> > click here. >> > NAML >> >> >> -- >> View this message in context: >> >> http://openjpa.208410.n2.nabble.com/Change-of-MappingDefaults-breaks-OPE= NJPA-SEQUENCE-TABLE-tp7580246p7580352.html > >> Sent from the OpenJPA Users mailing list archive at Nabble.com. >> > > > > -- > Thanks - Dianne > > > ________________________________ > If you reply to this email, your message will be added to the discussion > below: > http://openjpa.208410.n2.nabble.com/Change-of-MappingDefaults-breaks-OPEN= JPA-SEQUENCE-TABLE-tp7580246p7580363.html > To unsubscribe from Change of MappingDefaults breaks OPENJPA_SEQUENCE_TAB= LE, > click here. > NAML -- View this message in context: http://openjpa.208410.n2.nabble.com/Change-of= -MappingDefaults-breaks-OPENJPA-SEQUENCE-TABLE-tp7580246p7580367.html Sent from the OpenJPA Users mailing list archive at Nabble.com. ------=_Part_2232515_24178463.1340299518067--