mirror of
https://github.com/querydsl/querydsl.git
synced 2026-06-16 21:01:10 +08:00
42 lines
975 B
Java
42 lines
975 B
Java
package com.mysema.query.domain;
|
|
|
|
import org.junit.Test;
|
|
|
|
import com.mysema.query.annotations.QueryEntity;
|
|
import com.mysema.query.annotations.QueryProjection;
|
|
import com.mysema.query.types.expr.EString;
|
|
|
|
public class QueryProjectionTest {
|
|
|
|
@QueryEntity
|
|
public static class EntityWithProjection{
|
|
|
|
public EntityWithProjection(long id){
|
|
|
|
}
|
|
|
|
@QueryProjection
|
|
public EntityWithProjection(String name){
|
|
|
|
}
|
|
}
|
|
|
|
public static class DTOWithProjection {
|
|
|
|
public DTOWithProjection(long id){
|
|
|
|
}
|
|
|
|
@QueryProjection
|
|
public DTOWithProjection(String name){
|
|
|
|
}
|
|
}
|
|
|
|
@Test
|
|
public void test() throws SecurityException, NoSuchMethodException{
|
|
QEntityWithProjection.create(EString.create(""));
|
|
new QDTOWithProjection(EString.create(""));
|
|
}
|
|
}
|