String columnNameFromSchema
= (String) columnElement.getAttribute(
TorqueSchemaAttributeName.NAME);
if (columnNameFromSchema == null)
{
throw new SourceTransformerException("The attribute "
+ TorqueSchemaAttributeName.NAME.getName()
+ " on element "
+ columnElement.getName()
+ " is null");
}
SchemaType schemaType = null;
SqlType domain = getDomain(columnElement, controllerState);
if (domain != null && domain.getSqlTypeName() != null)
{
try
{
schemaType = SchemaType.valueOf(domain.getSqlTypeName());
}
catch (IllegalArgumentException e)
{
throw new SourceTransformerException("Unknown type "
+ domain.getSqlTypeName()
+ " in Domain definition");
}
}
else
{
String schemaTypeString = (String) columnElement.getAttribute(
TorqueSchemaAttributeName.TYPE.getName());
if (schemaTypeString == null)
{
throw new SourceTransformerException("type attribute not set"
+ " in Column "
+ columnNameFromSchema);
}
try
{
schemaType = SchemaType.valueOf(schemaTypeString);
}
catch (IllegalArgumentException e)
{
throw new SourceTransformerException("Unknown type "
+ schemaTypeString
+ " in Column "
+ columnNameFromSchema);
}
}