Package org.datanucleus.store.rdbms.sql.expression

Examples of org.datanucleus.store.rdbms.sql.expression.EnumExpression


            return new StringLiteral(stmt,
                exprFactory.getMappingForType(String.class, false), val.toString(), null);
        }
        else if (expr instanceof EnumExpression)
        {
            EnumExpression enumExpr = (EnumExpression)expr;
            JavaTypeMapping m = enumExpr.getJavaTypeMapping();
            if (m.getJavaTypeForDatastoreMapping(0).equals(ClassNameConstants.JAVA_LANG_STRING))
            {
                return enumExpr.getDelegate();
            }
            else
            {
                throw new NucleusException("EnumExpression.toString is not supported when the enum is stored as a numeric");
            }
View Full Code Here


            return new IntegerLiteral(stmt,
                exprFactory.getMappingForType(int.class, false), val.ordinal(), null);
        }
        else if (expr instanceof EnumExpression)
        {
            EnumExpression enumExpr = (EnumExpression)expr;
            JavaTypeMapping m = enumExpr.getJavaTypeMapping();
            if (m.getJavaTypeForDatastoreMapping(0).equals(ClassNameConstants.JAVA_LANG_STRING))
            {
                throw new NucleusException("EnumExpression.ordinal is not supported when the enum is stored as a string");
            }
            else
            {
                return enumExpr.getDelegate();
            }
        }
        else
        {
            throw new NucleusException(LOCALISER.msg("060001", "ordinal", expr));
View Full Code Here

TOP

Related Classes of org.datanucleus.store.rdbms.sql.expression.EnumExpression

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.