Bug 1017647

Summary: Invalid JPA mapping for ActvityType for MySQL
Product: [JBoss] JBoss Fuse Service Works 6 Reporter: Jiri Pechanec <jpechane>
Component: RT GovernanceAssignee: Gary Brown <gbrown>
Status: CLOSED NOTABUG QA Contact: Jiri Sedlacek <jsedlace>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 6.0.0CC: atangrin, jpechane, oskutka, soa-p-jira
Target Milestone: ---Keywords: Reopened
Target Release: ---Flags: gbrown: needinfo? (jpechane)
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-31 15:46:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Jiri Pechanec 2013-10-10 09:38:36 UTC
When a user tries to run a query
SELECT act FROM BPMActivityType act LEFT JOIN FETCH act.properties where act.processType='{urn:switchyard-soa:rtgov_activity_generation:0.1.0}Process' ORDER BY timestamp DESC

An exception is thrown
11:16:10,855 WARN  [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http-localhost/127.0.0.1:8080-1) SQL Error: 1054, SQLState: 42S22
11:16:10,855 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http-localhost/127.0.0.1:8080-1) Unknown column 'timestamp' in 'order clause'

The problem is that the column name in MySQL table is tstamp - instead of timestamp - but still property name is timestamp so it is not possible to refer to this field.

Comment 1 Jiri Pechanec 2013-10-10 10:03:12 UTC
A change of mapping was done in productization

Comment 2 Anne-Louise Tangring 2013-10-10 12:47:52 UTC
Not a beta blocker, this is advanced usage not thought to be used in beta.

Comment 3 Gary Brown 2013-10-10 13:13:50 UTC
Can you try adding 'act.' in front of the timestamp - e.g. "BY act.timestamp DESC" and let me know if that fixes for you - it works for me.

Comment 4 Gary Brown 2013-10-22 16:27:29 UTC
Have tested with the 'act.' prefix and it appears to resolve the problem, so have set the devel flag to '-'.

Comment 5 Gary Brown 2013-10-31 15:46:24 UTC
Don't believe this is a bug, but if further evidence becomes available then please reopen.