Package org.datanucleus.store.types

Examples of org.datanucleus.store.types.ObjectStringConverter


        {
            this.value = ((Character)value).toString();
        }
        else
        {
            ObjectStringConverter converter =
                stmt.getRDBMSManager().getNucleusContext().getTypeManager().getStringConverter(value.getClass());
            if (converter != null)
            {
                // Use converter
                this.value = converter.toString(value);
            }
            else
            {
                throw new NucleusException("Cannot create " + this.getClass().getName() +
                    " for value of type " + (value != null ? value.getClass().getName() : null));
View Full Code Here


            Date dateValue = ((Calendar)value).getTime();
            dbObject.put(fieldName, dateValue);
            return;
        }

        ObjectStringConverter strConv =
            ec.getNucleusContext().getTypeManager().getStringConverter(value.getClass());
        ObjectLongConverter longConv =
            ec.getNucleusContext().getTypeManager().getLongConverter(value.getClass());
        if (strConv != null)
        {
            // Persist as a String
            String strValue = strConv.toString(value);
            dbObject.put(fieldName, strValue);
        }
        else if (longConv != null)
        {
            // Persist as a Long
View Full Code Here

            Calendar cal = Calendar.getInstance();
            cal.setTime((Date)value);
            return cal;
        }

        ObjectStringConverter strConv =
            ec.getNucleusContext().getTypeManager().getStringConverter(mmd.getType());
        ObjectLongConverter longConv =
            ec.getNucleusContext().getTypeManager().getLongConverter(mmd.getType());
        Object returnValue = value;
        if (strConv != null)
        {
            // Persisted as a String, so convert back
            String strValue = (String)value;
            returnValue = strConv.toObject(strValue);
        }
        else if (longConv != null)
        {
            // Persisted as a Long, so convert back
            Long longValue = (Long)value;
View Full Code Here

TOP

Related Classes of org.datanucleus.store.types.ObjectStringConverter

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.