mirror of
https://github.com/querydsl/querydsl.git
synced 2026-07-03 21:07:49 +08:00
Add tests for map access with order
This commit is contained in:
parent
c59fe92a29
commit
d48f81c938
@ -1075,6 +1075,26 @@ public abstract class AbstractJPATest {
|
||||
assertEquals(1, query().from(show).where(show.acts.get("a").eq("A")).fetchCount());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void Map_Order_Get() {
|
||||
/*
|
||||
* select show
|
||||
* from Show show
|
||||
* left join show.parent.acts as show_parent_acts_0 with key(show_parent_acts_0) = ?1
|
||||
* order by show_parent_acts_0 asc
|
||||
*/
|
||||
QShow show = QShow.show;
|
||||
assertEquals(Arrays.asList(), query().from(show).orderBy(show.parent.acts.get("A").asc()).fetch());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void Map_Order_Get2() {
|
||||
QShow show = QShow.show;
|
||||
QShow parent = new QShow("parent");
|
||||
assertEquals(Arrays.asList(), query().from(show).innerJoin(show.parent, parent)
|
||||
.orderBy(parent.acts.get("A").asc()).fetch());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void Map_ContainsKey() {
|
||||
QShow show = QShow.show;
|
||||
|
||||
@ -31,6 +31,9 @@ public class Show {
|
||||
@MapKeyColumn(name = "acts_key")
|
||||
public Map<String, String> acts;
|
||||
|
||||
@ManyToOne
|
||||
public Show parent;
|
||||
|
||||
public Show() { }
|
||||
|
||||
public Show(int id) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user