return map;
}
private void createTaggedClassFromResult(HashMap<String, Object> result, ITypeInfo info, TypeData data) throws SQLException
{
ITypeInfo infoCursor;
TypeData dataCursor = null;
ClassContainer tmpClass;
Object tempVal;
for (Entry<String, Object> entry : result.entrySet())
{
dataCursor = data;
infoCursor = info;
if (entry.getKey().equalsIgnoreCase(UNIQUE))
{
data.setUniqueKey(entry.getValue().toString());
continue;
}
String[] fieldHeiarchy = entry.getKey().split(SEPERATOR);
if (fieldHeiarchy != null)
{
// Iterate over the list of items in the hierarchy to rebuild the
// TaggedClass.
for (int i = 0; i < fieldHeiarchy.length; ++i)
{
String name = fieldHeiarchy[i];
// Grab the next item
tmpClass = infoCursor.getTypeOfField(name);
// if its not the last one.
if (fieldHeiarchy.length > i + 1)
{
// An object lives here. Add a new taggedClass of this type.
tempVal = dataCursor.getFieldValue(name);
if (tempVal == null)
{
tempVal = DataStorageManager.getDataForType(tmpClass);
}
dataCursor.putField(name, tempVal);
// change the cursor to the new object.
dataCursor = (TypeData) tempVal;
infoCursor = infoCursor.getInfoForField(name);
}
else
{
// account for multivals.
if (name.contains(MULTI_MARKER))
{
name = name.replace("_" + MULTI_MARKER, "");
// get tmpClass again with new name.
tmpClass = infoCursor.getTypeOfField(name);
}
// Primitive type.
tempVal = valueToField(tmpClass, entry.getValue());
dataCursor.putField(name, tempVal);