Tabnine Logo
Mappings.findOrCreateFetchProfile
Code IndexAdd Tabnine to your IDE (free)

How to use
findOrCreateFetchProfile
method
in
org.hibernate.cfg.Mappings

Best Java code snippets using org.hibernate.cfg.Mappings.findOrCreateFetchProfile (Showing top 4 results out of 315)

origin: org.hibernate/com.springsource.org.hibernate

private static void parseFetchProfile(Element element, Mappings mappings, String containingEntityName) {
  String profileName = element.attributeValue( "name" );
  FetchProfile profile = mappings.findOrCreateFetchProfile( profileName, MetadataSource.HBM );
  Iterator itr = element.elementIterator( "fetch" );
  while ( itr.hasNext() ) {
    final Element fetchElement = ( Element ) itr.next();
    final String association = fetchElement.attributeValue( "association" );
    final String style = fetchElement.attributeValue( "style" );
    String entityName = fetchElement.attributeValue( "entity" );
    if ( entityName == null ) {
      entityName = containingEntityName;
    }
    if ( entityName == null ) {
      throw new MappingException( "could not determine entity for fetch-profile fetch [" + profileName + "]:[" + association + "]" );
    }
    profile.addFetch( entityName, association, style );
  }
}
origin: org.hibernate/com.springsource.org.hibernate.core

private static void parseFetchProfile(Element element, Mappings mappings, String containingEntityName) {
  String profileName = element.attributeValue( "name" );
  FetchProfile profile = mappings.findOrCreateFetchProfile( profileName, MetadataSource.HBM );
  Iterator itr = element.elementIterator( "fetch" );
  while ( itr.hasNext() ) {
    final Element fetchElement = ( Element ) itr.next();
    final String association = fetchElement.attributeValue( "association" );
    final String style = fetchElement.attributeValue( "style" );
    String entityName = fetchElement.attributeValue( "entity" );
    if ( entityName == null ) {
      entityName = containingEntityName;
    }
    if ( entityName == null ) {
      throw new MappingException( "could not determine entity for fetch-profile fetch [" + profileName + "]:[" + association + "]" );
    }
    profile.addFetch( entityName, association, style );
  }
}
origin: org.hibernate/com.springsource.org.hibernate.core

  public void doSecondPass(Map persistentClasses) throws MappingException {
    org.hibernate.mapping.FetchProfile profile = mappings.findOrCreateFetchProfile(
        fetchProfileName,
        MetadataSource.ANNOTATIONS
    );
    if ( MetadataSource.ANNOTATIONS != profile.getSource() ) {
      return;
    }

    PersistentClass clazz = mappings.getClass( fetch.entity().getName() );
    // throws MappingException in case the property does not exist
    clazz.getProperty( fetch.association() );

    profile.addFetch(
        fetch.entity().getName(), fetch.association(), fetch.mode().toString().toLowerCase()
    );
  }
}
origin: org.hibernate/com.springsource.org.hibernate

  public void doSecondPass(Map persistentClasses) throws MappingException {
    org.hibernate.mapping.FetchProfile profile = mappings.findOrCreateFetchProfile(
        fetchProfileName,
        MetadataSource.ANNOTATIONS
    );
    if ( MetadataSource.ANNOTATIONS != profile.getSource() ) {
      return;
    }

    PersistentClass clazz = mappings.getClass( fetch.entity().getName() );
    // throws MappingException in case the property does not exist
    clazz.getProperty( fetch.association() );

    profile.addFetch(
        fetch.entity().getName(), fetch.association(), fetch.mode().toString().toLowerCase()
    );
  }
}
org.hibernate.cfgMappingsfindOrCreateFetchProfile

Javadoc

Retrieves a fetch profile by either finding one currently in this repository matching the given name or by creating one (and adding it).

Popular methods of Mappings

  • addClass
    Add entity mapping metadata.
  • addImport
    Adds an import (HQL entity rename) to the repository.
  • addTable
    Adds table metadata to this repository returning the created metadata instance.
  • getCatalogName
    Returns the currently bound default catalog name.
  • getClass
    Retrieves the entity mapping metadata for the given entity name.
  • getSchemaName
    Returns the currently bound default schema name.
  • addCollection
    Add collection mapping metadata to this repository.
  • addSecondPass
    Adds a second pass.
  • addTableBinding
    Adds a table binding to this repository.
  • getDefaultAccess
    Get the current default property access style.
  • isAutoImport
    Determine whether auto importing of entity names is currently enabled.
  • addDenormalizedTable
    Adds a 'denormalized table' to this repository.
  • isAutoImport,
  • addDenormalizedTable,
  • addFilterDefinition,
  • addTypeDef,
  • addUniquePropertyReference,
  • getObjectNameNormalizer,
  • setAutoImport,
  • addColumnBinding,
  • addPropertyReference,
  • addQuery

Popular in Java

  • Finding current android device location
  • findViewById (Activity)
  • putExtra (Intent)
  • setRequestProperty (URLConnection)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Notification (javax.management)
  • Reference (javax.naming)
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Top plugins for Android Studio
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