org.dbtools.schema.dbmappings.DatabaseMapping Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dbtools-gen Show documentation
Show all versions of dbtools-gen Show documentation
DBTools ORM Class Generator.
package org.dbtools.schema.dbmappings;
import org.dbtools.schema.schemafile.SchemaFieldType;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.ElementList;
import org.simpleframework.xml.Root;
import java.util.ArrayList;
import java.util.List;
/**
* User: jcampbell
* Date: 2/4/14
*/
@Root
public class DatabaseMapping {
@Element(name = "name")
private String databaseName;
@ElementList(entry = "mapping", inline = true)
private List mappings = new ArrayList<>();
public String getSqlType(SchemaFieldType type) {
for (TypeMapping mapType : mappings) {
if (mapType.getJdbcType() == type) {
return mapType.getSqlType();
}
}
return null;
}
public String getDatabaseName() {
return databaseName;
}
public void setDatabaseName(String databaseName) {
this.databaseName = databaseName;
}
public List getMappings() {
return mappings;
}
public void setMappings(List mappings) {
this.mappings = mappings;
}
}