Tabnine Logo
Mapping.getReferencedPropertyType
Code IndexAdd Tabnine 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)

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

  • Updating database using SQL prepared statement
  • getSupportFragmentManager (FragmentActivity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getContentResolver (Context)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • From CI to AI: The AI layer in your organization
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