ActiveObjects SQL exception for column name when using AO plugin, but not TestActiveObjects

I implemented AO in my plugin and the IT tests (using TestActiveObjects and JUnitActiveObjectRunner) all pass to create, persist, update and find my objects.

But when I fire up my SDK instance of confluence the first query bombs out with

at $Proxy1297.prepareStatement(Unknown Source)

caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

caused by: java.sql.SQLSyntaxErrorException: user lacks privilege or object not found: ATTACHMENTID
at org.hsqldb.jdbc.Util.sqlException(Unknown Source)

caused by: org.hsqldb.HsqlException: user lacks privilege or object not found: ATTACHMENTID
at org.hsqldb.error.Error.error(Unknown Source)

since the field and query in question is "attachmentId" I am not sure why there is no underscore. Alternately I am not sure if that is just because I added that field later, but my upgrade task seems to be ignored. I tried an atlas-clean to blow away any previous HSQL db files, but the error continues.

"attachmentId = ? ",

public interface MyObject extends Entity{

	public long getAttachmentId();
	public void setAttachmentId(long id);

5 answers

Hmm, as I suspected the column generated by AO is using the underscore


so I need to figure out wjhy the query does not translate the same.

Yep, inserting underscores on camelCase boundaries is needed,

It wont, _you_ have interpret the fields and map accordingly, i.e. "attachmentId = ? " ==> "ATTACHMENT_ID = ? "

Not sure I follow Andy.. I understand the convention, and would expext the column to have underscores. The problem is that when running the query, the query generated is not using the underscores.

I guess my concerns is the inconsitency, as these queries work just fine using AO's ActiveObjectTest against hsqldb as instructed here?

And my understanding based on the examples from the author of AO doesn't use the underscore, as pointed in the document you linked to that should be handled by the FieldNameConverter

You can also see this a bit in the internals of the Query which converts the string to SQL using the field converter.,,,, boolean)

Suggest an answer

Log in or Sign up to answer
Community showcase

Scrum Roles Explained: the Do's and the Don'ts

Hello Community,  Today we are going to talk about the three Scrum Roles. There is the Development Team, the Scrum Master and the Product Owner. In my opinion these three are all really impo...

106 views 1 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you