/** * Returns the name of the schema to use for the persistent class. * * First the schema name in the {@link Configuration} is used. If null, * the schema name in the defined properties is returned. If null then * the provided mappingSchemaName is returned. If this is null too, * the class name, without the package, of the persistent class is returned. * * @param mappingSchemaName the name of the schema as read from the mapping file * @param persistentClass persistent class * @return String */ protected String getSchemaName(String mappingSchemaName, Class<?> persistentClass) { String confSchemaName = getOrCreateConf().get("preferred.schema.name"); if (confSchemaName != null) { return confSchemaName; } String schemaName = DataStoreFactory.getDefaultSchemaName(properties, this); if(schemaName != null) { return schemaName; } if(mappingSchemaName != null) { return mappingSchemaName; } return StringUtils.getClassname(persistentClass); } }
/** * Returns the name of the schema to use for the persistent class. * * First the schema name in the {@link Configuration} is used. If null, * the schema name in the defined properties is returned. If null then * the provided mappingSchemaName is returned. If this is null too, * the class name, without the package, of the persistent class is returned. * * @param mappingSchemaName the name of the schema as read from the mapping file * @param persistentClass persistent class * @return String */ protected String getSchemaName(String mappingSchemaName, Class<?> persistentClass) { String confSchemaName = getOrCreateConf().get("preferred.schema.name"); if (confSchemaName != null) { return confSchemaName; } String schemaName = DataStoreFactory.getDefaultSchemaName(properties, this); if(schemaName != null) { return schemaName; } if(mappingSchemaName != null) { return mappingSchemaName; } return StringUtils.getClassname(persistentClass); } }