mirror of
https://github.com/querydsl/querydsl.git
synced 2026-06-16 21:01:10 +08:00
#208 fixed NEGATE handling in OpenJPA
This commit is contained in:
parent
f6c8f280b8
commit
e5f0a080f7
@ -28,6 +28,7 @@ public class OpenJPATemplates extends JPQLTemplates{
|
||||
public OpenJPATemplates() {
|
||||
this(DEFAULT_ESCAPE);
|
||||
add(Ops.ALIAS, "{0} {1}");
|
||||
add(Ops.NEGATE, "-1 * {0}", 7);
|
||||
}
|
||||
|
||||
public OpenJPATemplates(char escape) {
|
||||
|
||||
@ -763,6 +763,11 @@ public abstract class AbstractStandardTest {
|
||||
assertEquals(val, projection.val, 0.001);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void Sum_4() {
|
||||
query().from(cat).uniqueResult(cat.bodyWeight.sum().negate());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void Sum_as_Float() {
|
||||
float val = query().from(cat).uniqueResult(cat.floatProperty.sum());
|
||||
|
||||
@ -144,7 +144,7 @@
|
||||
<property name="javax.persistence.jdbc.driver" value="org.h2.Driver" />
|
||||
<property name="javax.persistence.jdbc.url" value="jdbc:h2:target/h2-3" />
|
||||
<property name="javax.persistence.jdbc.user" value="sa" />
|
||||
<property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(SchemaAction='dropDB',ForeignKeys=true)"/>
|
||||
<property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/>
|
||||
<property name="openjpa.RuntimeUnenhancedClasses" value="supported" />
|
||||
<property name="openjpa.jdbc.Schemas" value="PUBLIC"/>
|
||||
<property name="openjpa.jdbc.DBDictionary" value="h2(useSchemaName=true)"/>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user