Tabnine Logo
MethodClassExtractor.getClassExtractionMethodName
Code IndexAdd Tabnine to your IDE (free)

How to use
getClassExtractionMethodName
method
in
org.eclipse.persistence.descriptors.MethodClassExtractor

Best Java code snippets using org.eclipse.persistence.descriptors.MethodClassExtractor.getClassExtractionMethodName (Showing top 6 results out of 315)

origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * ADVANCED:
 * A class extraction method can be registered with the descriptor to override the default inheritance mechanism.
 * This allows for a user defined class indicator in place of providing an explicit class indicator field.
 * The method registered must be a static method on the class which has that descriptor. The method must take a
 * Record as an argument (for example, a DatabaseRecord), and must return the class to use for that record.
 * This method will be used to decide which class to instantiate when reading from the database.
 * It is the application's responsibility to populate any typing information in the database required
 * to determine the class from the record.
 * If this method is used, then the class indicator field and mapping cannot be used, and in addition,
 * the descriptor's withAllSubclasses and onlyInstances expressions must also be setup correctly.
 *
 * @see #setWithAllSubclassesExpression(Expression)
 * @see #setOnlyInstancesExpression(Expression)
 */
public String getClassExtractionMethodName() {
  if (classExtractor instanceof MethodClassExtractor) {
    return ((MethodClassExtractor)classExtractor).getClassExtractionMethodName();
  } else {
    return null;
  }
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * ADVANCED:
 * A class extraction method can be registered with the descriptor to override the default inheritance mechanism.
 * This allows for a user defined class indicator in place of providing an explicit class indicator field.
 * The method registered must be a static method on the class which has that descriptor. The method must take a 
 * Record as an argument (for example, a DatabaseRecord), and must return the class to use for that record. 
 * This method will be used to decide which class to instantiate when reading from the database. 
 * It is the application's responsibility to populate any typing information in the database required
 * to determine the class from the record. 
 * If this method is used, then the class indicator field and mapping cannot be used, and in addition, 
 * the descriptor's withAllSubclasses and onlyInstances expressions must also be setup correctly.
 *
 * @see #setWithAllSubclassesExpression(Expression)
 * @see #setOnlyInstancesExpression(Expression)
 */
public String getClassExtractionMethodName() {
  if (classExtractor instanceof MethodClassExtractor) {
    return ((MethodClassExtractor)classExtractor).getClassExtractionMethodName();
  } else {
    return null;
  }
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * ADVANCED:
 * A class extraction method can be registered with the descriptor to override the default inheritance mechanism.
 * This allows for a user defined class indicator in place of providing an explicit class indicator field.
 * The method registered must be a static method on the class which has that descriptor. The method must take a 
 * Record as an argument (for example, a DatabaseRecord), and must return the class to use for that record. 
 * This method will be used to decide which class to instantiate when reading from the database. 
 * It is the application's responsibility to populate any typing information in the database required
 * to determine the class from the record. 
 * If this method is used, then the class indicator field and mapping cannot be used, and in addition, 
 * the descriptor's withAllSubclasses and onlyInstances expressions must also be setup correctly.
 *
 * @see #setWithAllSubclassesExpression(Expression)
 * @see #setOnlyInstancesExpression(Expression)
 */
public String getClassExtractionMethodName() {
  if (classExtractor instanceof MethodClassExtractor) {
    return ((MethodClassExtractor)classExtractor).getClassExtractionMethodName();
  } else {
    return null;
  }
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL:
 * Setup the default classExtractionMethod, or if one was specified by the user make sure it is valid.
 */
public void initialize(ClassDescriptor descriptor, Session session) throws DescriptorException {
  setDescriptor(descriptor);
  Class[] declarationParameters = new Class[1];
  declarationParameters[0] = ClassConstants.DatabaseRow_Class;
  try {
    setClassExtractionMethod(Helper.getDeclaredMethod(descriptor.getJavaClass(), getClassExtractionMethodName(), declarationParameters));
  } catch (NoSuchMethodException ignore) {
    declarationParameters[0] = ClassConstants.Record_Class;
    try {
      setClassExtractionMethod(Helper.getDeclaredMethod(descriptor.getJavaClass(), getClassExtractionMethodName(), declarationParameters));
    } catch (NoSuchMethodException exception) {
      throw DescriptorException.noSuchMethodWhileInitializingClassExtractionMethod(getClassExtractionMethodName(), descriptor, exception);
    } catch (SecurityException exception) {
      throw DescriptorException.securityWhileInitializingClassExtractionMethod(getClassExtractionMethodName(), descriptor, exception);
    }
  } catch (SecurityException exception) {
    throw DescriptorException.securityWhileInitializingClassExtractionMethod(getClassExtractionMethodName(), descriptor, exception);
  }
  // CR#2818667 Ensure the method is static.
  if (!Modifier.isStatic(getClassExtractionMethod().getModifiers())) {
    throw DescriptorException.classExtractionMethodMustBeStatic(getClassExtractionMethodName(), descriptor);
  }
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * INTERNAL:
 * Setup the default classExtractionMethod, or if one was specified by the user make sure it is valid.
 */
public void initialize(ClassDescriptor descriptor, Session session) throws DescriptorException {
  setDescriptor(descriptor);
  Class[] declarationParameters = new Class[1];
  declarationParameters[0] = ClassConstants.DatabaseRow_Class;
  try {
    setClassExtractionMethod(Helper.getDeclaredMethod(descriptor.getJavaClass(), getClassExtractionMethodName(), declarationParameters));
  } catch (NoSuchMethodException ignore) {
    declarationParameters[0] = ClassConstants.Record_Class;
    try {
      setClassExtractionMethod(Helper.getDeclaredMethod(descriptor.getJavaClass(), getClassExtractionMethodName(), declarationParameters));
    } catch (NoSuchMethodException exception) {
      throw DescriptorException.noSuchMethodWhileInitializingClassExtractionMethod(getClassExtractionMethodName(), descriptor, exception);
    } catch (SecurityException exception) {
      throw DescriptorException.securityWhileInitializingClassExtractionMethod(getClassExtractionMethodName(), descriptor, exception);
    }
  } catch (SecurityException exception) {
    throw DescriptorException.securityWhileInitializingClassExtractionMethod(getClassExtractionMethodName(), descriptor, exception);
  }
  // CR#2818667 Ensure the method is static.
  if (!Modifier.isStatic(getClassExtractionMethod().getModifiers())) {
    throw DescriptorException.classExtractionMethodMustBeStatic(getClassExtractionMethodName(), descriptor);
  }
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * INTERNAL:
 * Setup the default classExtractionMethod, or if one was specified by the user make sure it is valid.
 */
public void initialize(ClassDescriptor descriptor, Session session) throws DescriptorException {
  setDescriptor(descriptor);
  Class[] declarationParameters = new Class[1];
  declarationParameters[0] = ClassConstants.DatabaseRow_Class;
  try {
    setClassExtractionMethod(Helper.getDeclaredMethod(descriptor.getJavaClass(), getClassExtractionMethodName(), declarationParameters));
  } catch (NoSuchMethodException ignore) {
    declarationParameters[0] = ClassConstants.Record_Class;
    try {
      setClassExtractionMethod(Helper.getDeclaredMethod(descriptor.getJavaClass(), getClassExtractionMethodName(), declarationParameters));
    } catch (NoSuchMethodException exception) {
      throw DescriptorException.noSuchMethodWhileInitializingClassExtractionMethod(getClassExtractionMethodName(), descriptor, exception);
    }
  } catch (SecurityException exception) {
    throw DescriptorException.securityWhileInitializingClassExtractionMethod(getClassExtractionMethodName(), descriptor, exception);
  }
  // CR#2818667 Ensure the method is static.
  if (!Modifier.isStatic(getClassExtractionMethod().getModifiers())) {
    throw DescriptorException.classExtractionMethodMustBeStatic(getClassExtractionMethodName(), descriptor);
  }
}
org.eclipse.persistence.descriptorsMethodClassExtractorgetClassExtractionMethodName

Javadoc

PUBLIC: A class extraction method can be registered with the descriptor to override the default inheritance mechanism. This allows for the class indicator field to not be used, and a user defined one instead. The method registered must be a static method on the class that the descriptor is for, the method must take DatabaseRow as argument, and must return the class to use for that row. This method will be used to decide which class to instantiate when reading from the database. It is the application's responsibility to populate any typing information in the database required to determine the class from the row. If this method is used then the class indicator field and mapping cannot be used, also the descriptor's withAllSubclasses and onlyInstances expressions must also be setup correctly.

Popular methods of MethodClassExtractor

  • <init>
  • getClassExtractionMethod
    INTERNAL: Return all the classExtractionMethod
  • getDescriptor
    INTERNAL: Return the descriptor.
  • setClassExtractionMethod
    INTERNAL:
  • setClassExtractionMethodName
    PUBLIC: A class extraction method can be registered with the descriptor to override the default inhe
  • setDescriptor
    INTERNAL: Set the descriptor.

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSupportFragmentManager (FragmentActivity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getApplicationContext (Context)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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