ER关系字段
抽象实体路径
SELECT * FROM t_user WHERE
id IN (
SELECT user_id FROM a_user_and_role WHERE role_id IN (
SELECT id FROM t_role WHERE ...
)
)示例
嵌套查询
@Target(FIELD)
@Retention(RUNTIME)
public @interface DomainPath {
/**
* To describe how to route from the host domain to the target domain.
*
* @return paths array
*/
String[] value();
String localAlias() default "t";
/**
* The field in this domain to maintain the relationship with the target domain.
*
* @return name of the local field
*/
String localField() default "id";
/**
* The field in another domain to maintain the relationship with this domain.
*
* @return name of the foreign field
*/
String foreignField() default "id";
String foreignAlias() default "t1";
}
简单嵌套查询
最后更新于