/** * Find record by id. * * <pre> * Example: * Record user = Db.findById("user", "user_id", 123); * Record userRole = Db.findById("user_role", "user_id, role_id", 123, 456); * </pre> * * @param tableName the table name of the table * @param primaryKey the primary key of the table, composite primary key is separated by comma * character: "," * @param idValue the id value of the record, it can be composite id values */ public static Record findById(String tableName, String primaryKey, Object... idValue) { return dbPro.findById(tableName, primaryKey, idValue); }
/** * Find record by id with default primary key. * * <pre> * Example: * Record user = Db.findById("user", 15); * </pre> * * @param tableName the table name of the table * @param idValue the id value of the record */ public static Record findById(String tableName, Object idValue) { return dbPro.findById(tableName, idValue); }