Package com.forgeessentials.data.api

Examples of com.forgeessentials.data.api.TypeData


        // normal class delete thing.
        String statement = "DELETE FROM " + FEDATA_PREFIX + type.getFileSafeName() + " WHERE " + SURROUNDER + UNIQUE + SURROUNDER + "='" + unique + "'";
        list.add(statement);

        ITypeInfo info = DataStorageManager.getInfoForType(type);
        TypeData data = DataStorageManager.getDataForType(type);

        ResultSet set = getDbConnection().createStatement().executeQuery(createSelectStatement(type, unique));
        if (set.next())
        {
            createTaggedClassFromResult(resultRowToMap(set), info, data);
View Full Code Here


            data.add(new Pair(fieldName, tempStr.append("'").toString()));
        }
        else if (value.getClass().equals(TypeData.class))
        {
            // Tricky business involving recursion.
            TypeData tc = (TypeData) value;
            ITypeInfo info = DataStorageManager.getInfoForType(type);

            if (info instanceof TypeMultiValInfo || !info.canSaveInline())
            {
                // special stuff for Multivals. this will be a key going to a different table.
                data.add(new Pair(fieldName + "_" + MULTI_MARKER, tc.getUniqueKey()));

                // this will be removed what all the MultiVal ones are collected.
                data.add(new Pair(fieldName + "_" + MULTI_MARKER, tc));

                for (String name : info.getFieldList())
                {
                    data.addAll(fieldToValues(fieldName + SEPERATOR + name, info.getTypeOfField(name), tc.getFieldValue(name)));
                }
            }
            else
            {
                for (Entry<String, Object> f : tc.getAllFields())
                {
                    data.addAll(fieldToValues(fieldName + SEPERATOR + f.getKey(), info.getTypeOfField(f.getKey()), f.getValue()));
                }
            }
        }
View Full Code Here

                // get the data for the MultiVals
                Statement s = getDbConnection().createStatement();
                ResultSet result = s.executeQuery("SELECT * FROM " + FEDATA_PREFIX + targetType.getFileSafeName() + " WHERE " + MULTI_MARKER + "='" + ID + "'");

                TypeData data = DataStorageManager.getDataForType(targetType);

                TypeEntryInfo entryInfo = multiInfo.getEntryInfo();
                String connector = multiInfo.getEntryName();

                // create the MultiVal object
                TypeData temp;
                int i = 0;
                while (result.next())
                {
                    temp = DataStorageManager.getDataForType(info.getType());
                    createTaggedClassFromResult(resultRowToMap(result), entryInfo, data);
View Full Code Here

TOP

Related Classes of com.forgeessentials.data.api.TypeData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.