Examples of ReadObjectQuery


Examples of oracle.toplink.queryframework.ReadObjectQuery

  public Object readById(final Class entityClass, final Object[] keys, final boolean enforceReadOnly)
      throws DataAccessException {

    Assert.isTrue(keys != null && keys.length > 0, "Non-empty keys or id is required");

    ReadObjectQuery query = new ReadObjectQuery(entityClass);
    query.setSelectionKey(new Vector(Arrays.asList(keys)));
    Object result = executeQuery(query, enforceReadOnly);

    if (result == null) {
      Object identifier = (keys.length == 1 ? keys[0] : StringUtils.arrayToCommaDelimitedString(keys));
      throw new ObjectRetrievalFailureException(entityClass, identifier);
View Full Code Here

Examples of oracle.toplink.queryframework.ReadObjectQuery

  public Object readById(final Class entityClass, final Object[] keys, final boolean enforceReadOnly)
      throws DataAccessException {

    Assert.isTrue(keys != null && keys.length > 0, "Non-empty keys or id is required");

    ReadObjectQuery query = new ReadObjectQuery(entityClass);
    query.setSelectionKey(new Vector(Arrays.asList(keys)));
    Object result = executeQuery(query, enforceReadOnly);

    if (result == null) {
      Object identifier = (keys.length == 1 ? keys[0] : StringUtils.arrayToCommaDelimitedString(keys));
      throw new ObjectRetrievalFailureException(entityClass, identifier);
View Full Code Here

Examples of oracle.toplink.queryframework.ReadObjectQuery

   */
  @SuppressWarnings("boxing")
  public Developer readDeveloperById(int id) throws DataAccessException {

    Developer d = new Developer();
    ReadObjectQuery read = new ReadObjectQuery(Developer.class);
    d.setIdDeveloper(id);
    read.setExampleObject(d);

    Object o = getTopLinkTemplate().executeQuery(read);
    return (o != null) ? (Developer) o : null;
  }
View Full Code Here

Examples of oracle.toplink.queryframework.ReadObjectQuery

  @SuppressWarnings("boxing")
  public Developer readAndLockDeveloperById(int id)
      throws DataAccessException {

    Developer d = new Developer();
    ReadObjectQuery read = new ReadObjectQuery(Developer.class);
    d.setIdDeveloper(id);
    read.setExampleObject(d);
    read.acquireLocksWithoutWaiting();

    Object o = getTopLinkTemplate().executeQuery(read);
    return (o != null) ? (Developer) o : null;
  }
View Full Code Here

Examples of oracle.toplink.queryframework.ReadObjectQuery

   */
  @SuppressWarnings("boxing")
  public Developer readDeveloperById(int id) throws DataAccessException {

    Developer d = new Developer();
    ReadObjectQuery read = new ReadObjectQuery(Developer.class);
    d.setIdDeveloper(id);
    read.setExampleObject(d);

    Object o = getTopLinkTemplate().executeQuery(read);
    return (o != null) ? (Developer) o : null;
  }
View Full Code Here

Examples of org.eclipse.persistence.queries.ReadObjectQuery

            }

            // PROCESS TRANSFORMATION MAPPINGS
            List transformationMappings = treeObjectBuilder.getTransformationMappings();
            if (null != transformationMappings) {
                ReadObjectQuery query = new ReadObjectQuery();
                query.setSession(session);
                for (int x = 0, transformationMappingsSize = transformationMappings.size(); x < transformationMappingsSize; x++) {
                    AbstractTransformationMapping transformationMapping = (AbstractTransformationMapping)transformationMappings.get(x);
                    transformationMapping.readFromRowIntoObject(transformationRecord, null, currentObject, null, query, session, true);
                }
            }
View Full Code Here

Examples of org.eclipse.persistence.queries.ReadObjectQuery

                    // value read query
                    databaseQueryToInitialize = new ValueReadQuery();
                }
                else {
                    // read object query for the class mapped to the type
                    databaseQueryToInitialize = new ReadObjectQuery(xrService.getTypeClass(type));
                }
            }
        }
        else {
            databaseQueryToInitialize = new DataModifyQuery();
View Full Code Here

Examples of org.eclipse.persistence.queries.ReadObjectQuery

                int cacheUsage = ((Integer)valueToApply).intValue();
                ((ObjectLevelReadQuery)query).setCacheUsage(cacheUsage);
                if (cacheUsage == ObjectLevelReadQuery.CheckCacheByExactPrimaryKey
                        || cacheUsage == ObjectLevelReadQuery.CheckCacheByPrimaryKey
                        || cacheUsage == ObjectLevelReadQuery.CheckCacheThenDatabase) {
                    ReadObjectQuery newQuery = new ReadObjectQuery();
                    newQuery.copyFromQuery(query);
                    return newQuery;
                }
            } else if (query.isModifyAllQuery()) {
                int cacheUsage = ((Integer)valueToApply).intValue();
                ((ModifyAllQuery)query).setCacheUsage(cacheUsage);
View Full Code Here

Examples of org.eclipse.persistence.queries.ReadObjectQuery

            // Allows an query type, or a custom query class.
            DatabaseQuery newQuery = query;
            if (valueToApply.equals(QueryType.ReadAll)) {
                newQuery = new ReadAllQuery();
            } else if (valueToApply.equals(QueryType.ReadObject)) {
                newQuery = new ReadObjectQuery();
            } else if (valueToApply.equals(QueryType.Report)) {
                newQuery = new ReportQuery();
                if (query.isObjectLevelReadQuery()) {
                    ((ReportQuery)newQuery).addAttribute("root", ((ReportQuery)newQuery).getExpressionBuilder());
                }
View Full Code Here

Examples of org.eclipse.persistence.queries.ReadObjectQuery

                        if (!xrService.descriptorsByQName.containsKey(type)) {
                            databaseQueryToInitialize = new ValueReadQuery();
                        }
                        else {
                            // read object query for the class mapped to the type
                            databaseQueryToInitialize = new ReadObjectQuery(xrService.getTypeClass(type));
                        }
                    }
                    else {
                        // special case - no out args for SP: the return
                        // will be a single int
                        // rowcount
                        databaseQueryToInitialize = new DataModifyQuery();
                    }
                }
                else {
                    if (!xrService.descriptorsByQName.containsKey(type)) {
                      if (type.equals(SXF_QNAME)) {
                        databaseQueryToInitialize = new DataReadQuery();
                      }
                      else {
                        databaseQueryToInitialize = new ValueReadQuery();
                      }
                    }
                    else {
                        // read object query for the class mapped to the type
                        databaseQueryToInitialize = new ReadObjectQuery(xrService.getTypeClass(type));
                    }
                }
            }
        }
        else {
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.