mirror of
https://github.com/querydsl/querydsl.git
synced 2026-06-30 21:08:30 +08:00
fixed Embeddable handing issue
This commit is contained in:
parent
8939227b58
commit
95487c9751
@ -75,8 +75,10 @@ public class Processor {
|
||||
// populate super type mappings
|
||||
if (conf.getSuperTypeAnn() != null) {
|
||||
for (Element element : roundEnv.getElementsAnnotatedWith(conf.getSuperTypeAnn())) {
|
||||
BeanModel model = element.accept(entityVisitor, null);
|
||||
superTypes.put(model.getName(), model);
|
||||
if (conf.getEmbeddableAnn() == null || element.getAnnotation(conf.getEmbeddableAnn()) == null){
|
||||
BeanModel model = element.accept(entityVisitor, null);
|
||||
superTypes.put(model.getName(), model);
|
||||
}
|
||||
}
|
||||
// add supertype fields
|
||||
for (BeanModel superType : superTypes.values()) {
|
||||
@ -93,8 +95,10 @@ public class Processor {
|
||||
// populate entity type mappings
|
||||
Map<String, BeanModel> entityTypes = new HashMap<String, BeanModel>();
|
||||
for (Element element : roundEnv.getElementsAnnotatedWith(conf.getEntityAnn())) {
|
||||
BeanModel model = element.accept(entityVisitor, null);
|
||||
entityTypes.put(model.getName(), model);
|
||||
if (conf.getEmbeddableAnn() == null || element.getAnnotation(conf.getEmbeddableAnn()) == null){
|
||||
BeanModel model = element.accept(entityVisitor, null);
|
||||
entityTypes.put(model.getName(), model);
|
||||
}
|
||||
}
|
||||
superTypes.putAll(entityTypes);
|
||||
|
||||
|
||||
@ -38,7 +38,6 @@ public class QuerydslAnnotationProcessor extends AbstractProcessor{
|
||||
entity = QueryEntity.class;
|
||||
superType = QuerySupertype.class;
|
||||
embeddable = QueryEmbeddable.class;
|
||||
// dto = QueryProjection.class;
|
||||
skip = QueryTransient.class;
|
||||
|
||||
SimpleConfiguration configuration = new SimpleConfiguration(entity, superType, embeddable, skip);
|
||||
|
||||
@ -6,6 +6,7 @@ import org.junit.Test;
|
||||
|
||||
import com.mysema.query.annotations.QueryEmbeddable;
|
||||
import com.mysema.query.annotations.QueryEntity;
|
||||
import com.mysema.query.annotations.QuerySupertype;
|
||||
import com.mysema.query.domain.AnimalTest.Cat;
|
||||
|
||||
public class EmbeddableTest {
|
||||
@ -51,6 +52,18 @@ public class EmbeddableTest {
|
||||
|
||||
}
|
||||
|
||||
@QueryEntity
|
||||
@QueryEmbeddable
|
||||
public static class EntityAndEmbeddable{
|
||||
|
||||
}
|
||||
|
||||
@QuerySupertype
|
||||
@QueryEmbeddable
|
||||
public static class SuperclassAndEmbeddable{
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test(){
|
||||
|
||||
|
||||
@ -29,6 +29,43 @@ public class InheritanceTest {
|
||||
|
||||
}
|
||||
|
||||
@QueryEntity
|
||||
public abstract class BobbinGenOperation<M extends FlexPlasticFilm> extends Operation<M>{
|
||||
|
||||
}
|
||||
|
||||
@QueryEntity
|
||||
public abstract class Operation<M extends Merchandise> extends Entity{
|
||||
|
||||
}
|
||||
|
||||
@QueryEntity
|
||||
public abstract class FlexPlasticFilm extends FlexPlastic implements Rimmable{
|
||||
|
||||
}
|
||||
|
||||
@QueryEntity
|
||||
public abstract class FlexPlastic extends Storable{
|
||||
|
||||
}
|
||||
|
||||
public abstract class Storable extends Merchandise{
|
||||
|
||||
}
|
||||
|
||||
@QueryEntity
|
||||
public abstract class Merchandise extends Entity implements UnitConversionSupporter{
|
||||
|
||||
}
|
||||
|
||||
public interface Rimmable{
|
||||
|
||||
}
|
||||
|
||||
public interface UnitConversionSupporter{
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test(){
|
||||
// TODO
|
||||
|
||||
Loading…
Reference in New Issue
Block a user