#153 fixed annotation handling issues

This commit is contained in:
Timo Westkämper 2012-05-24 22:32:28 +03:00
parent 15145a9e5a
commit 41fd689d5f
2 changed files with 34 additions and 0 deletions

View File

@ -115,6 +115,7 @@ public final class ExtendedTypeFactory {
TypeElement typeElement = (TypeElement)declaredType.asElement();
switch(typeElement.getKind()){
case ENUM: return createEnumType(declaredType, typeElement, p);
case ANNOTATION_TYPE:
case CLASS: return createClassType(declaredType, typeElement, p);
case INTERFACE: return createInterfaceType(declaredType, typeElement, p);
default: throw new IllegalArgumentException("Illegal type " + typeElement);

View File

@ -0,0 +1,33 @@
package com.mysema.query.domain;
import java.lang.annotation.Annotation;
import javax.persistence.Embeddable;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import org.junit.Ignore;
@Ignore
public class AnnotationTypeTest {
@MappedSuperclass
public static abstract class BaseObject<T extends Annotation> {
}
@Entity
public static class Person extends BaseObject<javax.persistence.Id> {
@Id
private Long id;
}
@Embeddable
public static class Address extends BaseObject<javax.persistence.EmbeddedId> {
@EmbeddedId
private String street;
}
}