diff --git a/querydsl-core/src/main/java/com/mysema/query/codegen/EmbeddableSerializer.java b/querydsl-core/src/main/java/com/mysema/query/codegen/EmbeddableSerializer.java index f87274ab1..953a3c517 100644 --- a/querydsl-core/src/main/java/com/mysema/query/codegen/EmbeddableSerializer.java +++ b/querydsl-core/src/main/java/com/mysema/query/codegen/EmbeddableSerializer.java @@ -24,16 +24,7 @@ import com.mysema.codegen.model.Types; import com.mysema.query.types.Path; import com.mysema.query.types.PathMetadata; import com.mysema.query.types.expr.ComparableExpression; -import com.mysema.query.types.path.BeanPath; -import com.mysema.query.types.path.BooleanPath; -import com.mysema.query.types.path.ComparablePath; -import com.mysema.query.types.path.DatePath; -import com.mysema.query.types.path.DateTimePath; -import com.mysema.query.types.path.EnumPath; -import com.mysema.query.types.path.NumberPath; -import com.mysema.query.types.path.SimplePath; -import com.mysema.query.types.path.StringPath; -import com.mysema.query.types.path.TimePath; +import com.mysema.query.types.path.*; /** * EmbeddableSerializer is a Serializer implementation for embeddable types @@ -41,8 +32,8 @@ import com.mysema.query.types.path.TimePath; * @author tiwe * */ -public final class EmbeddableSerializer extends EntitySerializer{ - +public final class EmbeddableSerializer extends EntitySerializer { + @Inject public EmbeddableSerializer(TypeMappings typeMappings, @Named("keywords") Collection keywords) { super(typeMappings, keywords); @@ -74,6 +65,8 @@ public final class EmbeddableSerializer extends EntitySerializer{ for (Annotation annotation : model.getAnnotations()){ writer.annotation(annotation); } + + writer.line("@Generated(\"", getClass().getName(), "\")"); if (category == TypeCategory.BOOLEAN || category == TypeCategory.STRING){ writer.beginClass(queryType, new ClassType(pathType)); diff --git a/querydsl-core/src/main/java/com/mysema/query/codegen/EntitySerializer.java b/querydsl-core/src/main/java/com/mysema/query/codegen/EntitySerializer.java index c656fc944..5ccc402fa 100644 --- a/querydsl-core/src/main/java/com/mysema/query/codegen/EntitySerializer.java +++ b/querydsl-core/src/main/java/com/mysema/query/codegen/EntitySerializer.java @@ -9,10 +9,8 @@ import static com.mysema.codegen.Symbols.*; import java.io.IOException; import java.lang.annotation.Annotation; -import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Collection; -import java.util.Date; import java.util.HashSet; import java.util.List; import java.util.Set; @@ -57,13 +55,6 @@ public class EntitySerializer implements Serializer{ private static final Parameter PATH_INITS = new Parameter("inits", new ClassType(PathInits.class)); - private static final ThreadLocal ISO_8601_SIMPLE_DATE_FORMAT = new ThreadLocal() { - @Override - public SimpleDateFormat get() { - return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); - } - }; - protected final TypeMappings typeMappings; protected final Collection keywords; @@ -278,8 +269,7 @@ public class EntitySerializer implements Serializer{ // writer.suppressWarnings("all"); - writer.line("@Generated(value = \"", getClass().getName(), "\", ", - "date = \"", ISO_8601_SIMPLE_DATE_FORMAT.get().format(new Date()), "\")"); + writer.line("@Generated(\"", getClass().getName(), "\")"); if (category == TypeCategory.BOOLEAN || category == TypeCategory.STRING){ writer.beginClass(queryType, new ClassType(pathType));