use of io.jans.orm.exception.KeyConversionException in project jans by JanssenProject.
the class SqlConnectionProvider method getTableMappingByKey.
public TableMapping getTableMappingByKey(String key, String objectClass) {
String tableName = objectClass;
Map<String, String> columTypes = tableColumnsMap.get(tableName);
if ("_".equals(key)) {
return new TableMapping("", tableName, objectClass, columTypes);
}
String[] baseNameParts = key.split("_");
if (ArrayHelper.isEmpty(baseNameParts)) {
throw new KeyConversionException("Failed to determine base key part!");
}
TableMapping tableMapping = new TableMapping(baseNameParts[0], tableName, objectClass, columTypes);
return tableMapping;
}
use of io.jans.orm.exception.KeyConversionException in project jans by JanssenProject.
the class HybridEntryManager method getPersistenceEntryManagerByKey.
private PersistenceEntryManager getPersistenceEntryManagerByKey(String key) {
if ("_".equals(key)) {
return defaultPersistenceEntryManager;
}
String[] baseNameParts = key.split("_");
if (ArrayHelper.isEmpty(baseNameParts)) {
throw new KeyConversionException("Failed to determine base key part!");
}
PersistenceEntryManager persistenceEntryManager = baseNameToEntryManagerMapping.get(baseNameParts[0]);
if (persistenceEntryManager != null) {
return persistenceEntryManager;
}
return defaultPersistenceEntryManager;
}
use of io.jans.orm.exception.KeyConversionException in project jans by JanssenProject.
the class CouchbaseConnectionProvider method getBucketMappingByKey.
public BucketMapping getBucketMappingByKey(String key) {
if ("_".equals(key)) {
return defaultBucketMapping;
}
String[] baseNameParts = key.split("_");
if (ArrayHelper.isEmpty(baseNameParts)) {
throw new KeyConversionException("Failed to determine base key part!");
}
BucketMapping bucketMapping = baseNameToBucketMapping.get(baseNameParts[0]);
if (bucketMapping != null) {
return bucketMapping;
}
return defaultBucketMapping;
}
use of io.jans.orm.exception.KeyConversionException in project jans by JanssenProject.
the class SpannerConnectionProvider method getTableMappingByKey.
public TableMapping getTableMappingByKey(String key, String objectClass, String tableName) {
Map<String, StructField> columTypes = tableColumnsMap.get(tableName);
if (!tableColumnsMap.containsKey(tableName)) {
throw new MappingException(String.format("Table '%s' metadata is not exists '", tableName));
}
if ("_".equals(key)) {
return new TableMapping("", tableName, objectClass, columTypes);
}
String[] baseNameParts = key.split("_");
if (ArrayHelper.isEmpty(baseNameParts)) {
throw new KeyConversionException("Failed to determine base key part!");
}
TableMapping tableMapping = new TableMapping(baseNameParts[0], tableName, objectClass, columTypes);
return tableMapping;
}
Aggregations