I have the following query
Code:
update Device d set d.activationTs = :activationTs, d.lstUpdTs = SYSTIMESTAMP, d.lstUpdBy=:lstUpdBy where d.deviceServiceId=:serviceId
on oracle this is giving me 6 places after the decimal point for seconds. I need to reduce this to millisecond precision, so 3 numbers after the decimal place.
In a raw SQL session, i can pass a paramter to SYSTIMESTAMP to achieve this, but hibernate is incorrectly telling me that systimestamp takes no parameters. E.g.
Code:
select systimestamp(3) from dual;
Is there anyway i can pass the required precision to systimestamp when using hibernate?
Thanks,
Dan.
Code:
Caused by: org.hibernate.QueryException: function takes no arguments: systimestamp [update nz.co.vodafone.cmdb.model.Device d set d.activationTs = :activationTs, d.lstUpdTs = SYSTIMESTAMP(3), d.lstUpdBy=:lstUpdBy where d.deviceServiceId=:serviceId]
at org.hibernate.dialect.function.NoArgSQLFunction.render(NoArgSQLFunction.java:66) ~[hibernate-core-4.2.5.Final.jar:4.2.5.Final]
at org.hibernate.hql.internal.ast.SqlGenerator.endFunctionTemplate(SqlGenerator.java:220) ~[hibernate-core-4.2.5.Final.jar:4.2.5.Final]
at org.hibernate.hql.internal.antlr.SqlGeneratorBase.methodCall(SqlGeneratorBase.java:2326) ~[hibernate-core-4.2.5.Final.jar:4.2.5.Final]