We're updating the issue view to help you get more done. 

SQLException when preloading entities with one-to-many relation in MySQL

Description

I declared an entity "Company" with a one-to-many relation to the entity "Person". After i saw lots of queries hitting the database in the log, i wanted to enable preloading for both entities (with "@Preload"). It works when i declare it only on the entity "Company" (the "one" part), but as soon as i declare it on the entity "Person" (the "many" part), the following SQLException is thrown:

1 2 3 4 5 6 7 8 9 10 11 12 Caused by: java.sql.SQLException: Column '*' not found. at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1072) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:986) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:981) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926) at com.mysql.jdbc.ResultSetImpl.findColumn(ResultSetImpl.java:1144) at com.mysql.jdbc.ResultSetImpl.getObject(ResultSetImpl.java:5079) at com.mchange.v2.c3p0.impl.NewProxyResultSet.getObject(NewProxyResultSet.java:2313) at net.java.ao.EntityProxy.retrieveRelations(EntityProxy.java:817) at net.java.ao.EntityProxy.retrieveRelations(EntityProxy.java:517) at net.java.ao.EntityProxy.invoke(EntityProxy.java:177) ... 248 more

It only works when i specifically declare all the fields in the @Preload annotation (@Preload({"NAME", "AGE", ...})).

Environment

  • Confluence 3.4.1

  • mysql-5.5.8-osx10.6-x86_64

  • mysql-connector-java-5.1.11

Testing Notes

None

Status

Assignee

Samuel Le Berrigaud

Reporter

RemoS

Labels

None

Add-on Type

None

Team

None

CC

None

Risk factor

None

QA Kickoff Status

None

QA Demo Status

None

Components

Fix versions

Affects versions

ao-plugin 0.14.1

Priority

Major