Examples of SQLOperation


Examples of org.datanucleus.store.rdbms.sql.operation.SQLOperation

     * @throws UnsupportedOperationException if the operation is not specified
     */
    public SQLExpression invokeOperation(String name, SQLExpression expr, SQLExpression expr2)
    {
        // Try to find an instance of the SQLOperation
        SQLOperation operation = operationByOperationName.get(name);
        if (operation != null)
        {
            return operation.getExpression(expr, expr2);
        }

        // Try a datastore-specific key
        String datastoreId = storeMgr.getDatastoreAdapter().getVendorID();
        String key = getSQLOperationKey(datastoreId, name);
        String sqlOperationClassName = operationClassByDatastoreOperationName.get(key);
        if (sqlOperationClassName == null)
        {
            // Try a datastore-independent key
            key = getSQLOperationKey(null, name);
            sqlOperationClassName = operationClassByDatastoreOperationName.get(key);
            if (sqlOperationClassName == null)
            {
                throw new UnsupportedOperationException();
            }
        }

        // Use SQLOperation().getExpression(SQLExpression, SQLExpression)
        SQLStatement stmt = expr.getSQLStatement();
        try
        {
            operation = (SQLOperation)stmt.getClassLoaderResolver().classForName(sqlOperationClassName).newInstance();
            operation.setExpressionFactory(this);
            operationByOperationName.put(name, operation);

            return operation.getExpression(expr, expr2);
        }
        catch (ClassNotResolvedException cnre)
        {
            throw new NucleusException(LOCALISER.msg("060013", sqlOperationClassName));
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.