mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-12-01 15:37:14 +00:00
#1490 - FIX: withQuote_when_match for different platforms
This commit is contained in:
1 parent
b817d5ee4d
commit
9734ae5787
2 files changed
+10
-6
No files matched your search
@@ -3,7 +3,6 @@ package io.ebeaninternal.server.deploy;
|
||||
import io.ebean.BaseTestCase;
|
||||
import io.ebean.annotation.ForPlatform;
|
||||
import io.ebean.annotation.Platform;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.tests.model.basic.Address;
|
||||
import org.tests.model.basic.BWithQIdent;
|
||||
@@ -55,25 +54,29 @@ public class DeployPropertyParserTest extends BaseTestCase {
|
||||
assertThat(addressParser().parse("concat(line1, line2, '-EA')")).isEqualTo("concat(${}line_1, ${}line_2, '-EA')");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void withExplicitQuote_all_platforms() {
|
||||
assertThat(withQuoteParser().parse("t0.`CODE` like ?")).isEqualTo("t0.`CODE` like ?");
|
||||
assertThat(withQuoteParser().parse("t0.[CODE] like ?")).isEqualTo("t0.[CODE] like ?");
|
||||
assertThat(withQuoteParser().parse("t0.\"CODE\" like ?")).isEqualTo("t0.\"CODE\" like ?");
|
||||
}
|
||||
|
||||
@Test
|
||||
@ForPlatform(value = {Platform.H2, Platform.POSTGRES})
|
||||
public void withQuote_when_match_h2() {
|
||||
assertThat(withQuoteParser().parse("name like ?")).isEqualTo("${}\"Name\" like ?");
|
||||
assertThat(withQuoteParser().parse("t0.\"CODE\" like ?")).isEqualTo("t0.\"CODE\" like ?");
|
||||
}
|
||||
|
||||
@Test
|
||||
@ForPlatform(value = Platform.SQLSERVER)
|
||||
public void withQuote_when_match_sqlserver() {
|
||||
assertThat(withQuoteParser().parse("name like ?")).isEqualTo("${}[Name] like ?");
|
||||
assertThat(withQuoteParser().parse("t0.[CODE] like ?")).isEqualTo("t0.[CODE] like ?");
|
||||
}
|
||||
|
||||
@Test
|
||||
@ForPlatform(value = Platform.MYSQL)
|
||||
public void withQuote_when_match_mysql() {
|
||||
assertThat(withQuoteParser().parse("name like ?")).isEqualTo("${}`Name` like ?");
|
||||
assertThat(withQuoteParser().parse("t0.`CODE` like ?")).isEqualTo("t0.`CODE` like ?");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in new issue
Block a user