public abstract class AbstractRelation<SelfEntity> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected QueryColumn |
conditionColumn |
protected String |
dataSource |
protected List<String> |
extraConditionParamKeys |
protected String |
extraConditionSql |
protected String |
joinSelfColumn |
protected String |
joinTable |
protected String |
joinTargetColumn |
protected String |
name |
protected boolean |
onlyQueryValueField |
protected Field |
relationField |
protected FieldWrapper |
relationFieldWrapper |
protected String[] |
selectColumns |
protected Class<SelfEntity> |
selfEntityClass |
protected Field |
selfField |
protected FieldWrapper |
selfFieldWrapper |
protected String |
simpleName |
protected Class<?> |
targetEntityClass |
protected Field |
targetField |
protected FieldWrapper |
targetFieldWrapper |
protected String |
targetSchema |
protected String |
targetTable |
protected TableInfo |
targetTableInfo |
protected String |
valueField |
| Constructor and Description |
|---|
AbstractRelation(String selfField,
String targetSchema,
String targetTable,
String targetField,
String valueField,
String joinTable,
String joinSelfColumn,
String joinTargetColumn,
String dataSource,
Class<SelfEntity> entityClass,
Field relationField,
String extraCondition,
String[] selectColumns) |
protected String name
protected String simpleName
protected Class<SelfEntity> selfEntityClass
protected Field relationField
protected FieldWrapper relationFieldWrapper
protected Field selfField
protected FieldWrapper selfFieldWrapper
protected String targetSchema
protected String targetTable
protected Field targetField
protected String valueField
protected boolean onlyQueryValueField
protected Class<?> targetEntityClass
protected TableInfo targetTableInfo
protected FieldWrapper targetFieldWrapper
protected String joinTable
protected String joinSelfColumn
protected String joinTargetColumn
protected String dataSource
protected String extraConditionSql
protected QueryColumn conditionColumn
protected String[] selectColumns
public AbstractRelation(String selfField, String targetSchema, String targetTable, String targetField, String valueField, String joinTable, String joinSelfColumn, String joinTargetColumn, String dataSource, Class<SelfEntity> entityClass, Field relationField, String extraCondition, String[] selectColumns)
protected void initExtraCondition(String extraCondition)
public String getName()
public String getSimpleName()
public Class<SelfEntity> getSelfEntityClass()
public void setSelfEntityClass(Class<SelfEntity> selfEntityClass)
public Field getRelationField()
public void setRelationField(Field relationField)
public FieldWrapper getRelationFieldWrapper()
public void setRelationFieldWrapper(FieldWrapper relationFieldWrapper)
public Field getSelfField()
public void setSelfField(Field selfField)
public FieldWrapper getSelfFieldWrapper()
public void setSelfFieldWrapper(FieldWrapper selfFieldWrapper)
public Field getTargetField()
public void setTargetField(Field targetField)
public Class<?> getTargetEntityClass()
public void setTargetEntityClass(Class<?> targetEntityClass)
public TableInfo getTargetTableInfo()
public void setTargetTableInfo(TableInfo targetTableInfo)
public FieldWrapper getTargetFieldWrapper()
public void setTargetFieldWrapper(FieldWrapper targetFieldWrapper)
public String getTargetSchema()
public void setTargetSchema(String targetSchema)
public String getTargetTable()
public void setTargetTable(String targetTable)
public String getValueField()
public void setValueField(String valueField)
public boolean isOnlyQueryValueField()
public void setOnlyQueryValueField(boolean onlyQueryValueField)
public String getJoinTable()
public void setJoinTable(String joinTable)
public String getJoinSelfColumn()
public void setJoinSelfColumn(String joinSelfColumn)
public String getJoinTargetColumn()
public void setJoinTargetColumn(String joinTargetColumn)
public Set<Object> getSelfFieldValues(List<SelfEntity> selfEntities)
public Class<?> getMappingType()
public String getDataSource()
public void setDataSource(String dataSource)
public String getTargetTableWithSchema()
protected boolean isRelationByMiddleTable()
protected static Class<?> getTargetEntityClass(Class<?> entityClass, Field relationField)
protected static String getDefaultPrimaryProperty(String key, Class<?> entityClass, String message)
public QueryWrapper buildQueryWrapper(Set<Object> targetValues)
targetValues - 条件的值public void customizeQueryWrapper(QueryWrapper queryWrapper)
queryWrapper - 查询条件public abstract void join(List<SelfEntity> selfEntities, List<?> targetObjectList, List<Row> mappingRows)
selfEntities - 当前的实体类列表targetObjectList - 查询到的结果mappingRows - 中间表的映射数据,非中间表查询的场景下,mappingRows 永远为 nullCopyright © 2024. All rights reserved.