Hi Xavier!

I'd need to debug through this!

Can you probably share how you created the Entities and the database?
Do you create the DB manually or via OpenJPA?
Is there an explicit name in the @Column annotation or the orm?

In other words: for reproducing the problem we need to know pretty much exactly 
how your situation looks like.

Txs and LieGrue,
strub


> Am 19.05.2020 um 11:55 schrieb Xavier Baqués <x...@streamsets.com.INVALID>:
> 
> Hi,
> 
> Adding more context information, my use case is that I am trying to upgrade
> from MySQL 5.7.27 to MySQL 8 but in MySQL 8 there are new reserved words
> which collide with column names I am using on my tables. That is why I need
> to be able to delimit column names.
> 
> I tried to delimit column names in both MySQL 5 and MySQL 8 and got the
> same error message described in my previous email.
> 
> 
> 
> Thanks,
> 
> Xavier Baques
> 
> Software Engineer
> 
> ------------------------------
> 
> <https://www.facebook.com/streamsets/> <https://twitter.com/streamsets>
> <https://www.linkedin.com/company/streamsets/>
> 
> EMAIL: x...@streamsets.com
> 
> <https://streamsets.com>
> 
> <https://streamsets.com/products/transformer/>
> 
> <https://go.streamsets.com/WC-2019-Book-DataOps-Full-Book_LP.html>
> 
> 
> 
> On Tue, May 19, 2020 at 11:40 AM Xavier Baqués <x...@streamsets.com> wrote:
> 
>> Hi,
>> 
>> Sorry to bother you again but I've been trying to find a solution for
>> above issue but still couldn't find a way to make it work.
>> 
>> Any suggestions on what I could do to make it work?
>> 
>> 
>> Thanks,
>> 
>> Xavier Baques
>> 
>> Software Engineer
>> 
>> ------------------------------
>> 
>> <https://www.facebook.com/streamsets/> <https://twitter.com/streamsets>
>> <https://www.linkedin.com/company/streamsets/>
>> 
>> EMAIL: x...@streamsets.com
>> 
>> <https://streamsets.com>
>> 
>> <https://streamsets.com/products/transformer/>
>> 
>> <https://go.streamsets.com/WC-2019-Book-DataOps-Full-Book_LP.html>
>> 
>> 
>> 
>> On Wed, May 13, 2020 at 7:08 PM Xavier Baqués <x...@streamsets.com> wrote:
>> 
>>> Hi,
>>> 
>>> I am using OpenJPA with Delimited identifiers enabled through the orm.xml
>>> file, I am able to create the database schema and I can see debugging that
>>> table columns are correctly delimited with double quotes in Table object,
>>> however, when I ask EntityManager to create a query it loads the table
>>> metadata into the Table object without columns being delimited, only table
>>> name is delimited. As the columns in table metadata are not delimited, when
>>> the JPQL is parsed an exception is thrown because it cannot find delimited
>>> column names (they are correctly delimited from the corresponding Entity
>>> object) in table metadata (in this case the Table object that gets created
>>> from the table metadata does not have the column names delimited).
>>> 
>>> Is there any way to fix that by changing the configuration and make
>>> Delimited identifiers work correctly?
>>> 
>>> System information:
>>> 
>>> OpenJPA version: 2.4.3
>>> MySQL version: 5.7.27
>>> 
>>> Stack trace of the error:
>>> 
>>> <openjpa-2.4.3-r422266:1833086 fatal user error>
>>> org.apache.openjpa.persistence.ArgumentException:
>>> "com.streamsets.apps.pipelinestore.backend.bean.TestInfo.description"
>>> declares column ""DESCRIPTION"", but this column does not exist in table
>>> ""TEST_INFO"".
>>> at
>>> org.apache.openjpa.jdbc.meta.MappingInfo.mergeColumn(MappingInfo.java:692)
>>> at
>>> org.apache.openjpa.jdbc.meta.MappingInfo.createColumns(MappingInfo.java:593)
>>> at
>>> org.apache.openjpa.jdbc.meta.ValueMappingInfo.getColumns(ValueMappingInfo.java:178)
>>> at
>>> org.apache.openjpa.jdbc.meta.strats.StringFieldStrategy.map(StringFieldStrategy.java:84)
>>> at
>>> org.apache.openjpa.jdbc.meta.FieldMapping.setStrategy(FieldMapping.java:148)
>>> at
>>> org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy(RuntimeStrategyInstaller.java:81)
>>> at
>>> org.apache.openjpa.jdbc.meta.FieldMapping.resolveMapping(FieldMapping.java:498)
>>> at
>>> org.apache.openjpa.jdbc.meta.FieldMapping.resolve(FieldMapping.java:463)
>>> at
>>> org.apache.openjpa.jdbc.meta.ClassMapping.resolveNonRelationMappings(ClassMapping.java:921)
>>> at
>>> org.apache.openjpa.jdbc.meta.ClassMapping.resolveMapping(ClassMapping.java:858)
>>> at org.apache.openjpa.meta.ClassMetaData.resolve(ClassMetaData.java:1813)
>>> at
>>> org.apache.openjpa.meta.MetaDataRepository.processBuffer(MetaDataRepository.java:829)
>>> at
>>> org.apache.openjpa.meta.MetaDataRepository.resolveMapping(MetaDataRepository.java:784)
>>> at
>>> org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:664)
>>> at
>>> org.apache.openjpa.meta.MetaDataRepository.getMetaDataInternal(MetaDataRepository.java:418)
>>> at
>>> org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:389)
>>> at
>>> org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:472)
>>> at
>>> org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getClassMetaData(JPQLExpressionBuilder.java:177)
>>> at
>>> org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.resolveClassMetaData(JPQLExpressionBuilder.java:153)
>>> at
>>> org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateMetaData(JPQLExpressionBuilder.java:243)
>>> at
>>> org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateMetaData(JPQLExpressionBuilder.java:213)
>>> at
>>> org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateType(JPQLExpressionBuilder.java:206)
>>> at
>>> org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.access$200(JPQLExpressionBuilder.java:81)
>>> at
>>> org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.populate(JPQLExpressionBuilder.java:2445)
>>> at org.apache.openjpa.kernel.jpql.JPQLParser.populate(JPQLParser.java:60)
>>> at
>>> org.apache.openjpa.kernel.ExpressionStoreQuery.populateFromCompilation(ExpressionStoreQuery.java:162)
>>> at org.apache.openjpa.kernel.QueryImpl.newCompilation(QueryImpl.java:679)
>>> at
>>> org.apache.openjpa.kernel.QueryImpl.compilationFromCache(QueryImpl.java:652)
>>> at
>>> org.apache.openjpa.kernel.QueryImpl.compileForCompilation(QueryImpl.java:619)
>>> at
>>> org.apache.openjpa.kernel.QueryImpl.compileForExecutor(QueryImpl.java:688)
>>> at org.apache.openjpa.kernel.QueryImpl.compile(QueryImpl.java:588)
>>> at
>>> org.apache.openjpa.persistence.EntityManagerImpl.createQuery(EntityManagerImpl.java:1005)
>>> at
>>> org.apache.openjpa.persistence.EntityManagerImpl.createQuery(EntityManagerImpl.java:987)
>>> at
>>> org.apache.openjpa.persistence.EntityManagerImpl.createQuery(EntityManagerImpl.java:977)
>>> 
>>> 
>>> Thanks,
>>> 
>>> Xavier Baques
>>> 
>>> Software Engineer
>>> 
>>> ------------------------------
>>> 
>>> <https://www.facebook.com/streamsets/> <https://twitter.com/streamsets>
>>> <https://www.linkedin.com/company/streamsets/>
>>> 
>>> EMAIL: x...@streamsets.com
>>> 
>>> <https://streamsets.com>
>>> 
>>> <https://streamsets.com/products/transformer/>
>>> 
>>> <https://go.streamsets.com/WC-2019-Book-DataOps-Full-Book_LP.html>
>>> 
>>> 

Reply via email to