private static Optional<OrmInject> ofStream(Stream<Property> propertyStream) { return propertyStream .filter(property -> { SimpleTypeInfo returnTypeInfo = property.returnTypeInfo(); return returnTypeInfo.isSubType(Orm.class); }) .map(PropertyOrmInject::of) .findFirst(); }
@Override public boolean test(Property property) { return property.returnTypeInfo() .typeInfo() .map(typeInfo -> typeInfo.hasAnnotation(type)) .orElse(Boolean.FALSE) .booleanValue(); }
@Override public boolean test(Property property) { return property.returnTypeInfo() .typeInfo() .map(typeInfo -> typeInfo.hasAnnotation(type)) .orElse(Boolean.FALSE) .booleanValue(); }
@Lazy public List<ColumnOrmProperty> referencedPropertyList() { SimpleTypeInfo returnTypeInfo = property().returnTypeInfo(); Optional<OrmPojoInfo> maybePojoInfo = OrmPojoInfo.of(returnTypeInfo); return maybePojoInfo .map(this::referencedPropertyList0) .orElse(ImmutableList.of()); }
public static OrmInject of(Property property) { return new PropertyOrmInject( property, property.returnTypeInfo().typeName(), property.name()); }
public ParameterSpec parameterSpec(String name) { SimpleTypeInfo returnTypeInfo = property().returnTypeInfo(); TypeName typeName = returnTypeInfo.typeName(); return ParameterSpec.builder(typeName, name).build(); }
@Override public void acceptColumnsConstructor(ColumnsConstructor constructor) { constructor.set(property().returnTypeInfo().typeName(), property().name()); }
public static ForeignKeyOrmProperty of(Property property, AnnotationInfo foreignKeyAnnotationInfo) { List<SimpleTypeInfo> columnAnnotationClassList = foreignKeyAnnotationInfo .annotationInfo(ColumnAnnotationClassArray.class) .flatMap(ann -> ann.simpleTypeInfoArrayValue("value")) .get(); return ForeignKeyOrmProperty.builder() .property(property) .returnType(ReturnTypeHelper.of(property.returnTypeInfo()).returnType()) .tableInfo(TableInfoAnnotationInfo.of(foreignKeyAnnotationInfo)) .columnAnnotationClassList(columnAnnotationClassList) .columnSeq(columnAnnotationClassList.get(0) .typeInfo() .flatMap(t -> t.annotationInfo(ColumnSeq.class)) .flatMap(ann -> ann.annotationValueInfo("value")) .get() .intValue()) .foreignKeyAnnotationInfo(foreignKeyAnnotationInfo) .build(); }
@Override public CodeBlock onAutoIncrement() { CodeBlock.Builder code = CodeBlock.builder(); if (size == 1) { code.add(" .value($S, ($T) null)\n", property.columnSimpleName(), property.property().returnTypeInfo().autobox().className()); } return build(code.add(" .on(rs -> $L.onGeneratedKey($T.of(rs)))", property.property().name(), Result.class)); }
private static ColumnOrmProperty of0(Property property, AnnotationInfo columnAnnotationInfo) { SimpleTypeInfo returnTypeInfo = property.returnTypeInfo(); ReturnTypeHelper returnTypeHelper = ReturnTypeHelper.of(returnTypeInfo);