congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
InterfacePolicy.getChildDescriptors
Code IndexAdd Tabnine to your IDE (free)

How to use
getChildDescriptors
method
in
org.eclipse.persistence.descriptors.InterfacePolicy

Best Java code snippets using org.eclipse.persistence.descriptors.InterfacePolicy.getChildDescriptors (Showing top 14 results out of 315)

origin: com.haulmont.thirdparty/eclipselink

/**
 * INTERNAL:
 * Add child descriptor to the parent descriptor.
 */
public void addChildDescriptor(ClassDescriptor childDescriptor) {
  getChildDescriptors().add(childDescriptor);
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * INTERNAL:
 * Add child descriptor to the parent descriptor.
 */
public void addChildDescriptor(ClassDescriptor childDescriptor) {
  getChildDescriptors().addElement(childDescriptor);
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL:
 * Add child descriptor to the parent descriptor.
 */
public void addChildDescriptor(ClassDescriptor childDescriptor) {
  getChildDescriptors().add(childDescriptor);
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * INTERNAL:
 * Select one object of any concrete subclass.
 */
public Object selectOneObjectUsingMultipleTableSubclassRead(ReadObjectQuery query) throws DatabaseException, QueryException {
  Object object = null;
  for (Enumeration childDescriptors = getChildDescriptors().elements(); childDescriptors.hasMoreElements() && (object == null);) {
    ClassDescriptor descriptor = (ClassDescriptor)childDescriptors.nextElement();
    object = descriptor.getInterfacePolicy().selectOneObject(query);
  }
  return object;
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * INTERNAL:
 * Select all objects for an interface descriptor.
 * This is accomplished by selecting for all of the concrete classes and then merging the objects.
 *
 * @return Vector containing all objects.
 * @exception DatabaseException - an error has occurred on the database.
 */
public Object selectAllObjectsUsingMultipleTableSubclassRead(ReadAllQuery query) throws DatabaseException {
  org.eclipse.persistence.internal.queries.ContainerPolicy containerPolicy = query.getContainerPolicy();
  Object objects = containerPolicy.containerInstance(1);
  for (Enumeration childDescriptors = getChildDescriptors().elements(); childDescriptors.hasMoreElements();) {
    ClassDescriptor descriptor = (ClassDescriptor)childDescriptors.nextElement();
    objects = containerPolicy.concatenateContainers(objects, descriptor.getInterfacePolicy().selectAllObjects(query));
  }
  return objects;
}
 
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * INTERNAL:
 * Return the value to be stored in the object's attribute.
 * This will be a proxy object.
 */
public Object valueFromQuery(ReadQuery query, AbstractRecord row, AbstractSession session) {
  ClassDescriptor descriptor = null;
  try {
    // Need an instance of the implementing class
    //CR#3838
    descriptor = session.getDescriptor(query.getReferenceClass());
    if (descriptor.isDescriptorForInterface()) {
      descriptor = (ClassDescriptor)descriptor.getInterfacePolicy().getChildDescriptors().firstElement();
    }
  } catch (Exception e) {
    return null;
  }
  ValueHolderInterface valueHolder = new QueryBasedValueHolder(query, row, session);
  return ProxyIndirectionHandler.newProxyInstance(descriptor.getJavaClass(), targetInterfaces, valueHolder);
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL:
 * Return the value to be stored in the object's attribute.
 * This will be a proxy object.
 */
public Object valueFromQuery(ReadQuery query, AbstractRecord row, AbstractSession session) {
  ClassDescriptor descriptor = null;
  try {
    // Need an instance of the implementing class
    //CR#3838
    descriptor = session.getDescriptor(query.getReferenceClass());
    if (descriptor.isDescriptorForInterface()) {
      descriptor = descriptor.getInterfacePolicy().getChildDescriptors().get(0);
    }
  } catch (Exception e) {
    return null;
  }
  ValueHolderInterface valueHolder = new QueryBasedValueHolder(query, row, session);
  return ProxyIndirectionHandler.newProxyInstance(descriptor.getJavaClass(), targetInterfaces, valueHolder);
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * INTERNAL:
 * Return the value to be stored in the object's attribute.
 * This will be a proxy object.
 */
public Object valueFromQuery(ReadQuery query, AbstractRecord row, AbstractSession session) {
  ClassDescriptor descriptor = null;
  try {
    // Need an instance of the implementing class
    //CR#3838
    descriptor = session.getDescriptor(query.getReferenceClass());
    if (descriptor.isDescriptorForInterface()) {
      descriptor = descriptor.getInterfacePolicy().getChildDescriptors().get(0);
    }
  } catch (Exception e) {
    return null;
  }
  ValueHolderInterface valueHolder = new QueryBasedValueHolder(query, row, session);
  return ProxyIndirectionHandler.newProxyInstance(descriptor.getJavaClass(), targetInterfaces, valueHolder);
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * INTERNAL:
 * Return the value to be stored in the object's attribute.
 * This value is determined by the batch query.     *
 * NOTE: Currently not supported anyway.
 */
public Object valueFromBatchQuery(ReadQuery batchQuery, AbstractRecord row, ObjectLevelReadQuery originalQuery) {
  Object object;
  try {
    // Need an instance of the implementing class
    ClassDescriptor d = originalQuery.getDescriptor();
    if (d.isDescriptorForInterface()) {
      d = (ClassDescriptor)originalQuery.getDescriptor().getInterfacePolicy().getChildDescriptors().firstElement();
    }
    if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){
      object = AccessController.doPrivileged(new PrivilegedNewInstanceFromClass(d.getJavaClass()));
    }else{
      object = PrivilegedAccessHelper.newInstanceFromClass(d.getJavaClass());
    }
  } catch (Exception e) {
    //org.eclipse.persistence.internal.helper.Helper.toDo("*** Should probably throw some sort of TopLink exception here. ***");
    e.printStackTrace();
    return null;
  }
  ValueHolderInterface valueHolder = new BatchValueHolder(batchQuery, row, this.getForeignReferenceMapping(), originalQuery);
  return ProxyIndirectionHandler.newProxyInstance(object.getClass(), targetInterfaces, valueHolder);
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL:
 * Return the value to be stored in the object's attribute.
 * This value is determined by the batch query.     *
 * NOTE: Currently not supported anyway.
 */
public Object valueFromBatchQuery(ReadQuery batchQuery, AbstractRecord row, ObjectLevelReadQuery originalQuery, CacheKey parentCacheKey) {
  Object object;
  try {
    // Need an instance of the implementing class
    ClassDescriptor d = originalQuery.getDescriptor();
    if (d.isDescriptorForInterface()) {
      d = originalQuery.getDescriptor().getInterfacePolicy().getChildDescriptors().get(0);
    }
    if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){
      object = AccessController.doPrivileged(new PrivilegedNewInstanceFromClass(d.getJavaClass()));
    }else{
      object = PrivilegedAccessHelper.newInstanceFromClass(d.getJavaClass());
    }
  } catch (Exception e) {
    //org.eclipse.persistence.internal.helper.Helper.toDo("*** Should probably throw some sort of TopLink exception here. ***");
    e.printStackTrace();
    return null;
  }
  ValueHolderInterface valueHolder = new BatchValueHolder(batchQuery, row, this.getForeignReferenceMapping(), originalQuery, parentCacheKey);
  return ProxyIndirectionHandler.newProxyInstance(object.getClass(), targetInterfaces, valueHolder);
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * INTERNAL:
 * Return the value to be stored in the object's attribute.
 * This value is determined by the batch query.     *
 * NOTE: Currently not supported anyway.
 */
public Object valueFromBatchQuery(ReadQuery batchQuery, AbstractRecord row, ObjectLevelReadQuery originalQuery, CacheKey parentCacheKey) {
  Object object;
  try {
    // Need an instance of the implementing class
    ClassDescriptor d = originalQuery.getDescriptor();
    if (d.isDescriptorForInterface()) {
      d = originalQuery.getDescriptor().getInterfacePolicy().getChildDescriptors().get(0);
    }
    if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){
      object = AccessController.doPrivileged(new PrivilegedNewInstanceFromClass(d.getJavaClass()));
    }else{
      object = PrivilegedAccessHelper.newInstanceFromClass(d.getJavaClass());
    }
  } catch (Exception e) {
    //org.eclipse.persistence.internal.helper.Helper.toDo("*** Should probably throw some sort of TopLink exception here. ***");
    e.printStackTrace();
    return null;
  }
  ValueHolderInterface valueHolder = new BatchValueHolder(batchQuery, row, this.getForeignReferenceMapping(), originalQuery, parentCacheKey);
  return ProxyIndirectionHandler.newProxyInstance(object.getClass(), targetInterfaces, valueHolder);
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * INTERNAL:
 * Return the classifiction for the field contained in the mapping.
 * This is used to convert the row value to a consistent java value.
 */
public Class getFieldClassification(DatabaseField fieldToClassify) {
  if ((getTypeField() != null) && (fieldToClassify.equals(getTypeField()))) {
    return getTypeField().getType();
  }
  String queryKey = (String)getSourceToTargetQueryKeyNames().get(fieldToClassify);
  if (queryKey == null) {
    return null;
  }
  // Search any of the implementor descriptors for a mapping for the query-key.
  Iterator iterator = getReferenceDescriptor().getInterfacePolicy().getChildDescriptors().iterator();
  if (iterator.hasNext()) {
    ClassDescriptor firstChild = (ClassDescriptor)iterator.next();
    DatabaseMapping mapping = firstChild.getObjectBuilder().getMappingForAttributeName(queryKey);
    if ((mapping != null) && (mapping.isDirectToFieldMapping())) {
      return ((AbstractDirectMapping)mapping).getAttributeClassification();
    }
    QueryKey targetQueryKey = firstChild.getQueryKeyNamed(queryKey);
    if ((targetQueryKey != null) && (targetQueryKey.isDirectQueryKey())) {
      return firstChild.getObjectBuilder().getFieldClassification(((DirectQueryKey)targetQueryKey).getField());
    }            
  }
  return null;
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * INTERNAL:
 * Return the classification for the field contained in the mapping.
 * This is used to convert the row value to a consistent java value.
 */
@Override
public Class getFieldClassification(DatabaseField fieldToClassify) {
  if ((getTypeField() != null) && (fieldToClassify.equals(getTypeField()))) {
    return getTypeField().getType();
  }
  String queryKey = (String)getSourceToTargetQueryKeyNames().get(fieldToClassify);
  if (queryKey == null) {
    return null;
  }
  // Search any of the implementor descriptors for a mapping for the query-key.
  Iterator iterator = getReferenceDescriptor().getInterfacePolicy().getChildDescriptors().iterator();
  if (iterator.hasNext()) {
    ClassDescriptor firstChild = (ClassDescriptor)iterator.next();
    DatabaseMapping mapping = firstChild.getObjectBuilder().getMappingForAttributeName(queryKey);
    if ((mapping != null) && (mapping.isDirectToFieldMapping())) {
      return ((AbstractDirectMapping)mapping).getAttributeClassification();
    }
    QueryKey targetQueryKey = firstChild.getQueryKeyNamed(queryKey);
    if ((targetQueryKey != null) && (targetQueryKey.isDirectQueryKey())) {
      return firstChild.getObjectBuilder().getFieldClassification(((DirectQueryKey)targetQueryKey).getField());
    }            
  }
  return null;
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL:
 * Return the classification for the field contained in the mapping.
 * This is used to convert the row value to a consistent java value.
 */
@Override
public Class getFieldClassification(DatabaseField fieldToClassify) {
  if ((getTypeField() != null) && (fieldToClassify.equals(getTypeField()))) {
    return getTypeField().getType();
  }
  String queryKey = (String)getSourceToTargetQueryKeyNames().get(fieldToClassify);
  if (queryKey == null) {
    return null;
  }
  // Search any of the implementor descriptors for a mapping for the query-key.
  Iterator iterator = getReferenceDescriptor().getInterfacePolicy().getChildDescriptors().iterator();
  if (iterator.hasNext()) {
    ClassDescriptor firstChild = (ClassDescriptor)iterator.next();
    DatabaseMapping mapping = firstChild.getObjectBuilder().getMappingForAttributeName(queryKey);
    if ((mapping != null) && (mapping.isDirectToFieldMapping())) {
      return ((AbstractDirectMapping)mapping).getAttributeClassification();
    }
    QueryKey targetQueryKey = firstChild.getQueryKeyNamed(queryKey);
    if ((targetQueryKey != null) && (targetQueryKey.isDirectQueryKey())) {
      return firstChild.getObjectBuilder().getFieldClassification(((DirectQueryKey)targetQueryKey).getField());
    }
  }
  return null;
}
org.eclipse.persistence.descriptorsInterfacePolicygetChildDescriptors

Javadoc

INTERNAL: Return all the child descriptors.

Popular methods of InterfacePolicy

  • <init>
    INTERNAL: Create a new policy. Only descriptor involved in interface should have a policy.
  • addChildDescriptor
    INTERNAL: Add child descriptor to the parent descriptor.
  • addParentDescriptor
    INTERNAL: Add parent descriptor.
  • convertClassNamesToClasses
    INTERNAL: Convert all the class-name-based settings in this InheritancePolicy to actual class-based
  • getImplementorDescriptor
    INTERNAL: Returns the implementor descriptor class.
  • getParentDescriptors
    INTERNAL: Return all the parent descriptors.
  • getParentInterfaceNames
  • getParentInterfaces
    INTERNAL: Return the vector of parent interfaces.
  • initialize
    INTERNAL: Set the vector to store parent interfaces.
  • isInterfaceChildDescriptor
    INTERNAL: Check if it is a child descriptor.
  • isTablePerClassPolicy
    INTERNAL:
  • selectAllObjects
    INTERNAL: Select all objects for a concrete descriptor.
  • isTablePerClassPolicy,
  • selectAllObjects,
  • selectAllObjectsUsingMultipleTableSubclassRead,
  • selectOneObject,
  • selectOneObjectUsingMultipleTableSubclassRead,
  • setDescriptor,
  • usesImplementorDescriptor,
  • prepareQuery,
  • addParentInterfaceName

Popular in Java

  • Updating database using SQL prepared statement
  • scheduleAtFixedRate (Timer)
  • findViewById (Activity)
  • compareTo (BigDecimal)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now