Re: Why not OpenJPA map BigDecimal to NUMERIC(precision, scale) on database support NUMERIC

2012-10-17 Thread YaoCL
> I looked back through my emails from when I backed this change out and > can't figure out which test I regressed. The reason that I backed the > change out rather than fix the problem is because we were in the middle of > trying to cut a release. I'll open a new JIRA soon here and just recommit >

Antwort: AW: Antwort: AW: Antwort: AW: @Enumerated(EnumType.ORDINAL) in JPQL CASE WHEN generates invalid SQL using name of Enumeration member, not ordinal

2012-10-17 Thread it-media . kopp
Hello John, I have not, but will try. I was not aware, that OpenJPA supports CASE ordering. At least the Criteria API does not contain this feature. I thought this would be something only Hibernate or EclipseLink supported. But I might be wrong here. Thanks, Heiko -- Dr.-Ing. Heiko Kopp / Fa

AW: Antwort: AW: Antwort: AW: @Enumerated(EnumType.ORDINAL) in JPQL CASE WHEN generates invalid SQL using name of Enumeration member, not ordinal

2012-10-17 Thread Boblitz John
Yes, that is much clearer as to your intent. Have you tried this? SELECT c FROM DbContract c WHERE c.person.personId = :personId ORDER BY ( CASE c.approval.state WHEN ApprovalState.IN_PROCESS THEN 1 WHEN ApprovalState.RELATION_CHECK THEN 2 WHEN ApprovalSta

Antwort: AW: Antwort: AW: @Enumerated(EnumType.ORDINAL) in JPQL CASE WHEN generates invalid SQL using name of Enumeration member, not ordinal

2012-10-17 Thread it-media . kopp
Hello, that is correct. I need to do the SELECT CASE, because with this I'm applying a specific sort order to the members of the enumeration. E.g. I need to have GEN_STATUS value 14 which corresponds to enumeration value IN_APPROVAL to be before GEN_STATUS value 1 which corresponds to enumerat

AW: Antwort: AW: @Enumerated(EnumType.ORDINAL) in JPQL CASE WHEN generates invalid SQL using name of Enumeration member, not ordinal

2012-10-17 Thread Boblitz John
Sorry that didn't work ... If I'm reading it correctly, - in the DB you have a column "GEN_STATUS" which is a number type (integer?) - this number corresponds to your enumeration as the ordinal position - in the result, you want to show the number (and sort the results based on it) Is that corre

Antwort: AW: @Enumerated(EnumType.ORDINAL) in JPQL CASE WHEN generates invalid SQL using name of Enumeration member, not ordinal

2012-10-17 Thread it-media . kopp
Hello, that is not working, as you cannot simply use a method call withni JPQL ... I think this is a severe bug in the implementation. I tried to build up a query like this using Criteria API and Criteria API only allows to provide the enumeration at all when using a selectCase(), but the gene