Search in sources :

Example 1 with Location

use of com.querydsl.jpa.domain.Location in project querydsl by querydsl.

the class JPQLSerializerTest method fromWithCustomEntityName.

@Test
public void fromWithCustomEntityName() {
    JPQLSerializer serializer = new JPQLSerializer(HQLTemplates.DEFAULT);
    EntityPath<Location> entityPath = new EntityPathBase<Location>(Location.class, "entity");
    QueryMetadata md = new DefaultQueryMetadata();
    md.addJoin(JoinType.DEFAULT, entityPath);
    serializer.serialize(md, false, null);
    assertEquals("select entity\nfrom Location2 entity", serializer.toString());
}
Also used : DefaultQueryMetadata(com.querydsl.core.DefaultQueryMetadata) QueryMetadata(com.querydsl.core.QueryMetadata) DefaultQueryMetadata(com.querydsl.core.DefaultQueryMetadata) EntityPathBase(com.querydsl.core.types.dsl.EntityPathBase) Location(com.querydsl.jpa.domain.Location) Test(org.junit.Test)

Aggregations

DefaultQueryMetadata (com.querydsl.core.DefaultQueryMetadata)1 QueryMetadata (com.querydsl.core.QueryMetadata)1 EntityPathBase (com.querydsl.core.types.dsl.EntityPathBase)1 Location (com.querydsl.jpa.domain.Location)1 Test (org.junit.Test)1