mirror of
https://github.com/querydsl/querydsl.git
synced 2026-06-30 21:08:30 +08:00
addded javadocs for com.mysema.query.codegen
This commit is contained in:
parent
b9f8bac585
commit
5e2b74ed63
@ -6,6 +6,8 @@
|
||||
package com.mysema.query.codegen;
|
||||
|
||||
/**
|
||||
* AbstractSerializer is abstract base class for Serializer implementations
|
||||
*
|
||||
* @author tiwe
|
||||
*
|
||||
*/
|
||||
|
||||
@ -6,6 +6,8 @@
|
||||
package com.mysema.query.codegen;
|
||||
|
||||
/**
|
||||
* AbstractTypeModel is an abstract base class for TypeModel implementations
|
||||
*
|
||||
* @author tiwe
|
||||
*
|
||||
*/
|
||||
|
||||
@ -10,6 +10,12 @@ import java.io.Writer;
|
||||
|
||||
import net.jcip.annotations.Immutable;
|
||||
|
||||
/**
|
||||
* DTOSerializer is a Serializer implementation for DTO types
|
||||
*
|
||||
* @author tiwe
|
||||
*
|
||||
*/
|
||||
@Immutable
|
||||
public class DTOSerializer extends AbstractSerializer{
|
||||
|
||||
|
||||
@ -8,6 +8,12 @@ package com.mysema.query.codegen;
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
/**
|
||||
* EmbeddableSerializer is a Serializer implementation for embeddable types
|
||||
*
|
||||
* @author tiwe
|
||||
*
|
||||
*/
|
||||
public class EmbeddableSerializer extends EntitySerializer{
|
||||
|
||||
@Override
|
||||
|
||||
@ -12,6 +12,12 @@ import java.util.List;
|
||||
|
||||
import net.jcip.annotations.Immutable;
|
||||
|
||||
/**
|
||||
* EntitySerializer is a Serializer implementation for entity types
|
||||
*
|
||||
* @author tiwe
|
||||
*
|
||||
*/
|
||||
@Immutable
|
||||
public class EntitySerializer extends AbstractSerializer{
|
||||
|
||||
@ -84,17 +90,6 @@ public class EntitySerializer extends AbstractSerializer{
|
||||
|
||||
}
|
||||
|
||||
protected boolean hasOwnEntityProperties(EntityModel model){
|
||||
if (model.hasEntityFields()){
|
||||
for (PropertyModel property : model.getProperties()){
|
||||
if (!property.isInherited() && property.getType().getCategory() == TypeCategory.ENTITY){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void constructorsForVariables(StringBuilder builder, EntityModel model) {
|
||||
String simpleName = model.getSimpleName();
|
||||
String queryType = getQueryType(model, model, true);
|
||||
@ -119,8 +114,7 @@ public class EntitySerializer extends AbstractSerializer{
|
||||
builder.append(");\n");
|
||||
builder.append(" }\n\n");
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected void entityField(PropertyModel field, Writer writer) throws IOException {
|
||||
String queryType = getQueryType(field.getType(), field.getEntityModel(), false);
|
||||
|
||||
@ -132,6 +126,18 @@ public class EntitySerializer extends AbstractSerializer{
|
||||
writer.append(builder.toString());
|
||||
}
|
||||
|
||||
|
||||
protected boolean hasOwnEntityProperties(EntityModel model){
|
||||
if (model.hasEntityFields()){
|
||||
for (PropertyModel property : model.getProperties()){
|
||||
if (!property.isInherited() && property.getType().getCategory() == TypeCategory.ENTITY){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void initEntityFields(StringBuilder builder, EntityModel model) {
|
||||
EntityModel superModel = model.getSuperModel();
|
||||
if (superModel != null && superModel.hasEntityFields()){
|
||||
|
||||
@ -26,6 +26,9 @@ public interface Serializer {
|
||||
void serialize(EntityModel type, Writer writer) throws IOException;
|
||||
|
||||
/**
|
||||
* Get a String representation of the Querydsl type for the given TypeModel
|
||||
* in tyhe given EntityModel context
|
||||
*
|
||||
* @param type
|
||||
* @param model
|
||||
* @param raw
|
||||
|
||||
@ -16,6 +16,8 @@ import org.apache.commons.lang.ClassUtils;
|
||||
import com.mysema.commons.lang.Assert;
|
||||
|
||||
/**
|
||||
* SimpleClassTypeModel is a minimal implementation of the TypeModel interface
|
||||
*
|
||||
* @author tiwe
|
||||
*
|
||||
*/
|
||||
|
||||
@ -10,6 +10,8 @@ import java.io.IOException;
|
||||
import net.jcip.annotations.Immutable;
|
||||
|
||||
/**
|
||||
* SupertypeSerializer is a Serializer implementation for supertypes
|
||||
*
|
||||
* @author tiwe
|
||||
*
|
||||
*/
|
||||
|
||||
@ -24,7 +24,7 @@ import com.mysema.query.annotations.PropertyType;
|
||||
@Immutable
|
||||
public enum TypeCategory {
|
||||
/**
|
||||
* Simple non-entity fields
|
||||
*
|
||||
*/
|
||||
SIMPLE(null),
|
||||
/**
|
||||
@ -48,19 +48,19 @@ public enum TypeCategory {
|
||||
*/
|
||||
ARRAY(null),
|
||||
/**
|
||||
* Comparable literal fields (? extends Comparable)
|
||||
*
|
||||
*/
|
||||
COMPARABLE(SIMPLE),
|
||||
/**
|
||||
* Boolean files
|
||||
*
|
||||
*/
|
||||
BOOLEAN(COMPARABLE, Boolean.class.getName()),
|
||||
/**
|
||||
* Date fields
|
||||
*
|
||||
*/
|
||||
DATE(COMPARABLE, java.sql.Date.class.getName(), "org.joda.time.LocalDate"),
|
||||
/**
|
||||
* Date/Time fields
|
||||
*
|
||||
*/
|
||||
DATETIME(COMPARABLE,
|
||||
java.util.Calendar.class.getName(),
|
||||
@ -71,20 +71,20 @@ public enum TypeCategory {
|
||||
"org.joda.time.DateTime",
|
||||
"org.joda.time.DateMidnight"),
|
||||
/**
|
||||
* Entity fields
|
||||
*
|
||||
*/
|
||||
ENTITY(null),
|
||||
|
||||
/**
|
||||
* Numeric fields (? extends Number & Comparable)
|
||||
*
|
||||
*/
|
||||
NUMERIC(COMPARABLE),
|
||||
/**
|
||||
* String fields
|
||||
*
|
||||
*/
|
||||
STRING(COMPARABLE, String.class.getName()),
|
||||
/**
|
||||
* Time fields
|
||||
*
|
||||
*/
|
||||
TIME(COMPARABLE, java.sql.Time.class.getName(), "org.joda.time.LocalTime");
|
||||
|
||||
|
||||
@ -6,6 +6,8 @@
|
||||
package com.mysema.query.codegen;
|
||||
|
||||
/**
|
||||
* TypeExtendsModel is a TypeModel for type variables and wildcard types
|
||||
*
|
||||
* @author tiwe
|
||||
*
|
||||
*/
|
||||
|
||||
@ -8,6 +8,8 @@ package com.mysema.query.codegen;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* TypeModel represents Java types
|
||||
*
|
||||
* @author tiwe
|
||||
*
|
||||
*/
|
||||
|
||||
@ -8,6 +8,8 @@ package com.mysema.query.codegen;
|
||||
import com.mysema.commons.lang.Assert;
|
||||
|
||||
/**
|
||||
* TypeModelAdapter is a basic adapter implementation for the TypeModel interface
|
||||
*
|
||||
* @author tiwe
|
||||
*
|
||||
*/
|
||||
|
||||
@ -6,6 +6,8 @@
|
||||
package com.mysema.query.codegen;
|
||||
|
||||
/**
|
||||
* TypeSuperModel is a TypeModel for type variables and wildcard types
|
||||
*
|
||||
* @author tiwe
|
||||
*
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user