Package org.datanucleus.store.mapped.mapping

Examples of org.datanucleus.store.mapped.mapping.PersistableIdMapping


                    AbstractClassMetaData cmd = storeMgr.getMetaDataManager().getMetaDataForClass(className, clr);
                    if (cmd.getIdentityType() == IdentityType.APPLICATION)
                    {
                        Class cls = clr.classForName(className);
                        m = exprFactory.getMappingForType(cls, false);
                        m = new PersistableIdMapping((PersistableMapping) m);
                    }
                }

                if (m == null)
                {
View Full Code Here


        SQLTable discrimSqlTbl = SQLStatementHelper.getSQLTableForMappingOfTable(sqlStmt, sqlStmt.getPrimaryTable(), discrimMapping);
        sqlStmt.select(discrimSqlTbl, discrimMapping, null);

        // Restrict to this id
        JavaTypeMapping idMapping = primaryTable.getIdMapping();
        JavaTypeMapping idParamMapping = new PersistableIdMapping((PersistableMapping) idMapping);
        SQLExpression sqlFldExpr = exprFactory.newExpression(sqlStmt, sqlStmt.getPrimaryTable(), idMapping);
        SQLExpression sqlFldVal = exprFactory.newLiteralParameter(sqlStmt, idParamMapping, id, "ID");
        sqlStmt.whereAnd(sqlFldExpr.eq(sqlFldVal), true);

        // Perform the query
View Full Code Here

            sqlStmtMain.union(sqlStmt);
        }

        // WHERE (object id) = ?
        JavaTypeMapping idMapping = sqlStmtMain.getPrimaryTable().getTable().getIdMapping();
        JavaTypeMapping idParamMapping = new PersistableIdMapping((PersistableMapping) idMapping);
        SQLExpression fieldExpr = exprFactory.newExpression(sqlStmtMain, sqlStmtMain.getPrimaryTable(), idMapping);
        SQLExpression fieldVal = exprFactory.newLiteralParameter(sqlStmtMain, idParamMapping, id, "ID");
        sqlStmtMain.whereAnd(fieldExpr.eq(fieldVal), true);

        // Perform the query
View Full Code Here

                        }
                        else if (ec.getApiAdapter().isDetached(value))
                        {
                            // Detached, so avoid re-attaching
                            Object id = ec.getApiAdapter().getIdForObject(value);
                            PersistableIdMapping idMapping = new PersistableIdMapping((PersistableMapping)mapping);
                            idMapping.setObject(ec, ps, MappingHelper.getMappingIndices(num, idMapping), id);
                        }
                        else
                        {
                            mapping.setObject(ec, ps, MappingHelper.getMappingIndices(num, mapping), value);
                        }
View Full Code Here

        else if (ObjectExpression.class.isAssignableFrom(expr.getClass()))
        {
            // When the expression represents a PC object need to extract out as the identity
            if (expr.getJavaTypeMapping() instanceof PersistableMapping)
            {
                JavaTypeMapping mapping = new PersistableIdMapping((PersistableMapping)expr.getJavaTypeMapping());
                return new ObjectExpression(stmt, expr.getSQLTable(), mapping);
            }
            else if (expr.getJavaTypeMapping() instanceof ReferenceMapping)
            {
                JavaTypeMapping mapping = new ReferenceIdMapping((ReferenceMapping)expr.getJavaTypeMapping());
View Full Code Here

TOP

Related Classes of org.datanucleus.store.mapped.mapping.PersistableIdMapping

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.