Codota Logo
Mapping.getReferencedPropertyType
Code IndexAdd Codota to your IDE (free)

How to use
getReferencedPropertyType
method
in
org.hibernate.engine.spi.Mapping

Best Java code snippets using org.hibernate.engine.spi.Mapping.getReferencedPropertyType (Showing top 6 results out of 315)

  • Common ways to obtain Mapping
private void myMethod () {
Mapping m =
  • Codota IconPersistentClass persistentClass;!persistentClass.hasIdentifierProperty()
  • Smart code suggestions by Codota
}
origin: hibernate/hibernate-orm

private boolean hasNonIdentifierPropertyNamedId(final EntityType entityType, final Mapping factory) {
  // TODO : would be great to have a Mapping#hasNonIdentifierPropertyNamedId method
  // I don't believe that Mapping#getReferencedPropertyType accounts for the identifier property; so
  // if it returns for a property named 'id', then we should have a non-id field named id
  try {
    return factory.getReferencedPropertyType(
        entityType.getAssociatedEntityName(),
        EntityPersister.ENTITY_ID
    ) != null;
  }
  catch (MappingException e) {
    return false;
  }
}
origin: hibernate/hibernate-orm

/**
 * Determine the type of either (1) the identifier if we reference the
 * associated entity's PK or (2) the unique key to which we refer (i.e.
 * the property-ref).
 *
 * @param factory The mappings...
 *
 * @return The appropriate type.
 *
 * @throws MappingException Generally, if unable to resolve the associated entity name
 * or unique key property name.
 */
public final Type getIdentifierOrUniqueKeyType(Mapping factory) throws MappingException {
  if ( isReferenceToPrimaryKey() || uniqueKeyPropertyName == null ) {
    return getIdentifierType( factory );
  }
  else {
    Type type = factory.getReferencedPropertyType( getAssociatedEntityName(), uniqueKeyPropertyName );
    if ( type.isEntityType() ) {
      type = ( (EntityType) type ).getIdentifierOrUniqueKeyType( factory );
    }
    return type;
  }
}
origin: org.hibernate/com.springsource.org.hibernate.core

private boolean hasNonIdentifierPropertyNamedId(final EntityType entityType, final Mapping factory) {
  // TODO : would be great to have a Mapping#hasNonIdentifierPropertyNamedId method
  // I don't believe that Mapping#getReferencedPropertyType accounts for the identifier property; so
  // if it returns for a property named 'id', then we should have a non-id field named id
  try {
    return factory.getReferencedPropertyType( entityType.getAssociatedEntityName(), EntityPersister.ENTITY_ID ) != null;
  }
  catch( MappingException e ) {
    return false;
  }
}
origin: org.hibernate/com.springsource.org.hibernate

private boolean hasNonIdentifierPropertyNamedId(final EntityType entityType, final Mapping factory) {
  // TODO : would be great to have a Mapping#hasNonIdentifierPropertyNamedId method
  // I don't believe that Mapping#getReferencedPropertyType accounts for the identifier property; so
  // if it returns for a property named 'id', then we should have a non-id field named id
  try {
    return factory.getReferencedPropertyType( entityType.getAssociatedEntityName(), EntityPersister.ENTITY_ID ) != null;
  }
  catch( MappingException e ) {
    return false;
  }
}
origin: org.hibernate/com.springsource.org.hibernate.core

/**
 * Determine the type of either (1) the identifier if we reference the
 * associated entity's PK or (2) the unique key to which we refer (i.e.
 * the property-ref).
 *
 * @param factory The mappings...
 * @return The appropriate type.
 * @throws MappingException Generally, if unable to resolve the associated entity name
 * or unique key property name.
 */
public final Type getIdentifierOrUniqueKeyType(Mapping factory) throws MappingException {
  if ( isReferenceToPrimaryKey() ) {
    return getIdentifierType(factory);
  }
  else {
    Type type = factory.getReferencedPropertyType( getAssociatedEntityName(), uniqueKeyPropertyName );
    if ( type.isEntityType() ) {
      type = ( ( EntityType ) type).getIdentifierOrUniqueKeyType( factory );
    }
    return type;
  }
}
origin: org.hibernate/com.springsource.org.hibernate

/**
 * Determine the type of either (1) the identifier if we reference the
 * associated entity's PK or (2) the unique key to which we refer (i.e.
 * the property-ref).
 *
 * @param factory The mappings...
 * @return The appropriate type.
 * @throws MappingException Generally, if unable to resolve the associated entity name
 * or unique key property name.
 */
public final Type getIdentifierOrUniqueKeyType(Mapping factory) throws MappingException {
  if ( isReferenceToPrimaryKey() ) {
    return getIdentifierType(factory);
  }
  else {
    Type type = factory.getReferencedPropertyType( getAssociatedEntityName(), uniqueKeyPropertyName );
    if ( type.isEntityType() ) {
      type = ( ( EntityType ) type).getIdentifierOrUniqueKeyType( factory );
    }
    return type;
  }
}
org.hibernate.engine.spiMappinggetReferencedPropertyType

Popular methods of Mapping

  • getIdentifierPropertyName
  • getIdentifierGeneratorFactory
    Allow access to the id generator factory, though this is only needed/allowed from configuration.
  • getIdentifierType

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSystemService (Context)
  • addToBackStack (FragmentTransaction)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • PrintStream (java.io)
    A PrintStream adds functionality to another output stream, namely the ability to print representatio
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now