public static String getIdName(String tableName) { return Inflector.singularize(tableName).toLowerCase() + "_id"; }
/** * FK name is a foreign key name used in relationships as a foreign key column in a child table (table represented by this * instance is a parent table). * The FK name is derived using {@link org.javalite.common.Inflector}: It is a singular version of this table name plus "_id". * * @return foreign key name used in relationships as a foreign key column in a child table. */ public String getFKName() { return singularize(getTableName()).toLowerCase() + "_id"; }
private MetaModel inferTargetMetaModel(String targetTableName){ String targetTable = singularize(targetTableName); MetaModel targetMM = metaModelFor(targetTable); if(targetMM == null){ targetTable = pluralize(targetTableName); targetMM = metaModelFor(targetTable); } return targetMM != null? targetMM: null; }
@Override public String getEntityCollectionName(String name) { return Inflector.singularize(name); }
public static String getIdName(String tableName) { return Inflector.singularize(tableName).toLowerCase() + "_id"; }
public static String getIdName(String tableName) { return Inflector.singularize(tableName).toLowerCase() + "_id"; }
/** * Constructs the name of the method from the collectionName * * @param prefix * @param collectionName * @return */ private String getMethodName(String prefix, String collectionName) { collectionName = Inflector.singularize(collectionName); return prefix + collectionName.substring(0, 1).toUpperCase() + collectionName.substring(1); } }
/** * FK name is a foreign key name used in relationships as a foreign key column in a child table (table represented by this * instance is a parent table). * The FK name is derived using {@link org.javalite.common.Inflector}: It is a singular version of this table name plus "_id". * * @return foreign key name used in relationships as a foreign key column in a child table. */ public String getFKName() { return singularize(getTableName()).toLowerCase() + "_id"; }
/** * FK name is a foreign key name used in relationships as a foreign key column in a child table (table represented by this * instance is a parent table). * The FK name is derived using {@link org.javalite.common.Inflector}: It is a singular version of this table name plus "_id". * * @return foreign key name used in relationships as a foreign key column in a child table. */ public String getFKName() { return singularize(getTableName()).toLowerCase() + "_id"; }
/** * FK name is a foreign key name used in relationships as a foreign key column in a child table (table represented by this * instance is a parent table). * The FK name is derived using {@link org.javalite.common.Inflector}: It is a singular version of this table name plus "_id". * * @return foreign key name used in relationships as a foreign key column in a child table. */ public String getFKName() { return singularize(getTableName()).toLowerCase() + "_id"; }
@Override public String getEntityName(CollectionMetaData collection) { return Inflector.singularize(collection.getName()); }
private MetaModel inferTargetMetaModel(String targetTableName){ String targetTable = singularize(targetTableName); MetaModel targetMM = metaModelFor(targetTable); if(targetMM == null){ targetTable = pluralize(targetTableName); targetMM = metaModelFor(targetTable); } return targetMM != null? targetMM: null; }
private MetaModel inferTargetMetaModel(String targetTableName){ String targetTable = singularize(targetTableName); MetaModel targetMM = Registry.instance().getMetaModel(targetTable); if(targetMM == null){ targetTable = pluralize(targetTableName); targetMM = Registry.instance().getMetaModel(targetTable); } return targetMM != null? targetMM: null; }