public boolean isFieldOutlineEnumerated(Mapping context, FieldOutline fieldOutline) { final CPropertyInfo propertyInfo = fieldOutline.getPropertyInfo(); final Collection<? extends CTypeInfo> types = context.getGetTypes() .process(context, propertyInfo); if (types.size() == 1) { final CTypeInfo type = types.iterator().next(); return type instanceof CEnumLeafInfo; } else { return false; } }
public boolean isFieldOutlineComplex(Mapping context, FieldOutline fieldOutline) { final CPropertyInfo propertyInfo = fieldOutline.getPropertyInfo(); final Collection<? extends CTypeInfo> types = context.getGetTypes() .process(context, propertyInfo); assert types.size() == 1; final CTypeInfo type = types.iterator().next(); return type instanceof CClass; }
public final boolean isEnumerated(Mapping context, FieldOutline fieldOutline) { final CPropertyInfo propertyInfo = fieldOutline.getPropertyInfo(); final Collection<? extends CTypeInfo> types = context.getGetTypes() .process(context, propertyInfo); assert types.size() == 1; final CTypeInfo type = types.iterator().next(); return type instanceof CEnumLeafInfo; }
public boolean isFieldOutlineSingletypedHomogeneous(Mapping context, FieldOutline fieldOutline) { final Collection<? extends CTypeInfo> types = context.getGetTypes() .process(context, fieldOutline.getPropertyInfo()); return types.size() == 1; }
private FieldOutline getFieldOutline( final ClassOutline clazz, final String fieldName ) { for ( FieldOutline f : clazz.getDeclaredFields() ) { if ( f.getPropertyInfo().getName( false ).equals( fieldName ) ) { return f; } } return null; }
public boolean isFieldOutlineEmbeddedId(Mapping context, FieldOutline fieldOutline) { final Collection<? extends CTypeInfo> types = context.getGetTypes() .process(context, fieldOutline.getPropertyInfo()); assert types.size() == 1; final CTypeInfo type = types.iterator().next(); return (type instanceof CClass && CustomizationUtils .containsCustomization(fieldOutline, Customizations.EMBEDDED_ID_ELEMENT_NAME)); }
private String getTargetEntityTable$Name(Mapping context, FieldOutline fieldOutline) { final CPropertyInfo propertyInfo = fieldOutline.getPropertyInfo(); final Collection<? extends CTypeInfo> types = context.getGetTypes() .process(context, propertyInfo); assert types.size() == 1; final CTypeInfo type = types.iterator().next(); assert type instanceof CClass; final CClass childClassInfo = (CClass) type; return getEntityTableName(context, childClassInfo); }
public static JFieldVar field(FieldOutline fieldOutline) { final JDefinedClass theClass = fieldOutline.parent().implClass; return theClass.fields().get( fieldOutline.getPropertyInfo().getName(false)); }
public static JFieldVar field(FieldOutline fieldOutline) { final JDefinedClass theClass = fieldOutline.parent().implClass; return theClass.fields().get( fieldOutline.getPropertyInfo().getName(false)); }
public CTypeInfo getCommonBaseTypeInfo(Mapping context, FieldOutline fieldOutline) { final CPropertyInfo propertyInfo = fieldOutline.getPropertyInfo(); final Collection<? extends CTypeInfo> types = context.getGetTypes() .process(context, propertyInfo); return CTypeInfoUtils.getCommonBaseTypeInfo(types); }
public static JMethod issetter(FieldOutline fieldOutline) { final JDefinedClass theClass = fieldOutline.parent().implClass; final String publicName = fieldOutline.getPropertyInfo().getName(true); final String name = "isSet" + publicName; return theClass.getMethod(name, NONE); }
public static JMethod issetter(FieldOutline fieldOutline) { final JDefinedClass theClass = fieldOutline.parent().implClass; final String publicName = fieldOutline.getPropertyInfo().getName(true); final String name = "isSet" + publicName; return theClass.getMethod(name, NONE); }
public static JMethod getter(FieldOutline fieldOutline) { final JDefinedClass theClass = fieldOutline.parent().implClass; final String publicName = fieldOutline.getPropertyInfo().getName(true); final String name = "get" + publicName; return theClass.getMethod(name, NONE); }
public void createOneToOne$TargetEntity(Mapping context, FieldOutline fieldOutline, final OneToOne oneToOne) { final CPropertyInfo propertyInfo = fieldOutline.getPropertyInfo(); final Collection<? extends CTypeInfo> types = context.getGetTypes() .process(context, propertyInfo); assert types.size() == 1; final CTypeInfo type = types.iterator().next(); assert type instanceof CClass; final CClass childClassInfo = (CClass) type; oneToOne.setTargetEntity(context.getNaming().getEntityClass(context, fieldOutline.parent().parent(), childClassInfo.getType())); }
public static JMethod setter(FieldOutline fieldOutline) { final JMethod getter = getter(fieldOutline); assert getter != null : "Getter is required."; final JType type = getter.type(); final JDefinedClass theClass = fieldOutline.parent().implClass; final String publicName = fieldOutline.getPropertyInfo().getName(true); final String name = "set" + publicName; return theClass.getMethod(name, new JType[] { type }); }
public static JMethod setter(FieldOutline fieldOutline) { final JMethod getter = getter(fieldOutline); assert getter != null : "Getter is required."; final JType type = getter.type(); final JDefinedClass theClass = fieldOutline.parent().implClass; final String publicName = fieldOutline.getPropertyInfo().getName(true); final String name = "set" + publicName; return theClass.getMethod(name, new JType[] { type }); }
public static JMethod setter(FieldOutline fieldOutline) { final JMethod getter = getter(fieldOutline); assert getter != null : "Getter is required."; final JType type = getter.type(); final JDefinedClass theClass = fieldOutline.parent().implClass; final String publicName = fieldOutline.getPropertyInfo().getName(true); final String name = "set" + publicName; return theClass.getMethod(name, new JType[] { type }); }
public String getColumn$Name$Prefix(Mapping context) { final String prefix; final Embedded embedded = context.getCustomizing().getEmbedded( parentFieldOutline); if (embedded != null && embedded.getColumnNamePrefix() != null) { prefix = embedded.getColumnNamePrefix(); } else { prefix = naming.getColumn$Name$Prefix(context) + parentFieldOutline.getPropertyInfo().getName(true) + "_"; } return prefix; }
public void createManyToMany$TargetEntity(Mapping context, FieldOutline fieldOutline, final ManyToMany manyToMany) { final CPropertyInfo propertyInfo = fieldOutline.getPropertyInfo(); final Collection<? extends CTypeInfo> types = context.getGetTypes() .process(context, propertyInfo); final CTypeInfo type = CTypeInfoUtils.getCommonBaseTypeInfo(types); assert type != null; assert type instanceof CClass; final CClass childClassInfo = (CClass) type; manyToMany.setTargetEntity(context.getNaming().getEntityClass(context, fieldOutline.parent().parent(), childClassInfo.getType())); }
public void createOneToMany$TargetEntity(Mapping context, FieldOutline fieldOutline, final OneToMany oneToMany) { final CPropertyInfo propertyInfo = fieldOutline.getPropertyInfo(); final Collection<? extends CTypeInfo> types = context.getGetTypes() .process(context, propertyInfo); final CTypeInfo type = CTypeInfoUtils.getCommonBaseTypeInfo(types); assert type != null; assert type instanceof CClass; final CClass childClassInfo = (CClass) type; oneToMany.setTargetEntity(context.getNaming().getEntityClass(context, fieldOutline.parent().parent(), childClassInfo.getType())); }