}
}
@SuppressWarnings({ "unchecked", "rawtypes" })
public M parent(Class<? extends Model> model) {
Parent parent = model.getAnnotation(Parent.class);
String foreignKey = parent.foreignKey();
Class<? extends Model> parentModel = parent.model();
String parentTableName = TableMapping.me().getTable(parentModel).getName();
String primaryKey = TableMapping.me().getTable(clazz).getPrimaryKey();
try {
return (M) parentModel.newInstance().findFirst(
"select * from " + parentTableName + " where " + foreignKey + "= ?", get(primaryKey));