Tabnine Logo
CollectionDescriptor.getReverseReferenceDescriptor
Code IndexAdd Tabnine to your IDE (free)

How to use
getReverseReferenceDescriptor
method
in
org.intermine.metadata.CollectionDescriptor

Best Java code snippets using org.intermine.metadata.CollectionDescriptor.getReverseReferenceDescriptor (Showing top 11 results out of 315)

origin: org.intermine/intermine-model

/**
 * {@inheritDoc}
 */
@Override
public int relationType() {
  ReferenceDescriptor rd = getReverseReferenceDescriptor();
  if (rd == null || rd instanceof CollectionDescriptor) {
    return M_N_RELATION;
  } else {
    return ONE_N_RELATION;
  }
}
origin: intermine/intermine

/**
 * {@inheritDoc}
 */
@Override
public int relationType() {
  ReferenceDescriptor rd = getReverseReferenceDescriptor();
  if (rd == null || rd instanceof CollectionDescriptor) {
    return M_N_RELATION;
  } else {
    return ONE_N_RELATION;
  }
}
origin: intermine/intermine

if (!indirections.contains(collection.getReverseReferenceDescriptor())) {
  indirections.add(collection);
origin: org.intermine/intermine-objectstore

if (!indirections.contains(collection.getReverseReferenceDescriptor())) {
  indirections.add(collection);
origin: org.intermine/intermine-objectstore

    schema.getVersion());
if ((columnName.compareTo(columnName2) < 0)
  || (col.getReverseReferenceDescriptor() == null)) {
  addStatement(statements,
         tableName + "__"  + columnName, tableName,
origin: org.intermine/intermine-objectstore

/**
 * Creates a column name for the "outward" key of a many-to-many collection descriptor.
 *
 * @param col CollectionDescriptor
 * @param version the database version number
 * @return a valid column name
 */
public static String getOutwardIndirectionColumnName(CollectionDescriptor col, int version) {
  if (FieldDescriptor.M_N_RELATION != col.relationType()) {
    throw new IllegalArgumentException("Argument must be a CollectionDescriptor for a "
                      + "many-to-many relation");
  }
  if (version == 0) {
    ReferenceDescriptor rd = col.getReverseReferenceDescriptor();
    String colName = (rd == null
      ? TypeUtil.unqualifiedName(col.getClassDescriptor().getName())
      : rd.getName());
    return StringUtil.capitalise(generateSqlCompatibleName(colName));
  } else if (version == 1) {
    return StringUtil.capitalise(generateSqlCompatibleName(col.getName()));
  } else {
    throw new IllegalArgumentException("Database version number " + version
        + " not recognised");
  }
}
origin: intermine/intermine

/**
 * Creates a column name for the "inward" key of a many-to-many collection descriptor.
 *
 * @param col CollectionDescriptor
 * @param version the database version number
 * @return a valid column name
 */
public static String getInwardIndirectionColumnName(CollectionDescriptor col, int version) {
  if (FieldDescriptor.M_N_RELATION != col.relationType()) {
    throw new IllegalArgumentException("Argument must be a CollectionDescriptor for a "
                      + "many-to-many relation");
  }
  if (version == 0) {
    return StringUtil.capitalise(generateSqlCompatibleName(col.getName()));
  } else if (version == 1) {
    ReferenceDescriptor rd = col.getReverseReferenceDescriptor();
    String colName = (rd == null
      ? TypeUtil.unqualifiedName(col.getClassDescriptor().getName())
      : rd.getName());
    return StringUtil.capitalise(generateSqlCompatibleName(colName));
  } else {
    throw new IllegalArgumentException("Database version number " + version
        + " not recognised");
  }
}
origin: intermine/intermine

    schema.getVersion());
if ((columnName.compareTo(columnName2) < 0)
  || (col.getReverseReferenceDescriptor() == null)) {
  addStatement(statements,
         tableName + "__"  + columnName, tableName,
origin: org.intermine/intermine-objectstore

/**
 * Creates a column name for the "inward" key of a many-to-many collection descriptor.
 *
 * @param col CollectionDescriptor
 * @param version the database version number
 * @return a valid column name
 */
public static String getInwardIndirectionColumnName(CollectionDescriptor col, int version) {
  if (FieldDescriptor.M_N_RELATION != col.relationType()) {
    throw new IllegalArgumentException("Argument must be a CollectionDescriptor for a "
                      + "many-to-many relation");
  }
  if (version == 0) {
    return StringUtil.capitalise(generateSqlCompatibleName(col.getName()));
  } else if (version == 1) {
    ReferenceDescriptor rd = col.getReverseReferenceDescriptor();
    String colName = (rd == null
      ? TypeUtil.unqualifiedName(col.getClassDescriptor().getName())
      : rd.getName());
    return StringUtil.capitalise(generateSqlCompatibleName(colName));
  } else {
    throw new IllegalArgumentException("Database version number " + version
        + " not recognised");
  }
}
origin: intermine/intermine

/**
 * Creates a column name for the "outward" key of a many-to-many collection descriptor.
 *
 * @param col CollectionDescriptor
 * @param version the database version number
 * @return a valid column name
 */
public static String getOutwardIndirectionColumnName(CollectionDescriptor col, int version) {
  if (FieldDescriptor.M_N_RELATION != col.relationType()) {
    throw new IllegalArgumentException("Argument must be a CollectionDescriptor for a "
                      + "many-to-many relation");
  }
  if (version == 0) {
    ReferenceDescriptor rd = col.getReverseReferenceDescriptor();
    String colName = (rd == null
      ? TypeUtil.unqualifiedName(col.getClassDescriptor().getName())
      : rd.getName());
    return StringUtil.capitalise(generateSqlCompatibleName(colName));
  } else if (version == 1) {
    return StringUtil.capitalise(generateSqlCompatibleName(col.getName()));
  } else {
    throw new IllegalArgumentException("Database version number " + version
        + " not recognised");
  }
}
origin: intermine/intermine

public void testReverseReferenceValid() throws Exception {
  // codd1 in Class1 points to Class2, cod2 in Class2 points to Class1
  CollectionDescriptor cod1 = new CollectionDescriptor("cod1", "package.name.Class2", "cod2");
  CollectionDescriptor cod2 = new CollectionDescriptor("cod2", "package.name.Class1", "cod1");
  Set<CollectionDescriptor> cols1 = Collections.singleton(cod1);
  Set<CollectionDescriptor> cols2 = Collections.singleton(cod2);
  ClassDescriptor cld1 = new ClassDescriptor("package.name.Class1", null, false, noAttrs, noRefs, cols1);
  ClassDescriptor cld2 = new ClassDescriptor("package.name.Class2", null, false, noAttrs, noRefs, cols2);
  new Model("model", "package.name", Arrays.asList(cld1, cld2));
  try {
    ReferenceDescriptor rfdReverse = cod1.getReverseReferenceDescriptor();
    assertEquals(cod2, rfdReverse);
    assertEquals(cld1, rfdReverse.getReferencedClassDescriptor());
  } catch (IllegalStateException e) {
    fail("Should have returned reverse ReferenceDescriptor");
  }
}
org.intermine.metadataCollectionDescriptorgetReverseReferenceDescriptor

Popular methods of CollectionDescriptor

  • <init>
    Construct a CollectionDescriptor. name and referencedType may not be null.
  • getReferencedClassDescriptor
  • getClassDescriptor
  • getName
  • getReferencedClassName
  • getReverseReferenceFieldName
  • relationType
  • findReferencedDescriptor
  • equals
  • hashCode
  • setClassDescriptor
  • toString
  • setClassDescriptor,
  • toString

Popular in Java

  • Updating database using SQL prepared statement
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • setContentView (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • JPanel (javax.swing)
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • CodeWhisperer alternatives
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