Codota Logo
Mappings.findOrCreateFetchProfile
Code IndexAdd Codota 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)

  • Common ways to obtain Mappings
private void myMethod () {
Mappings m =
  • Codota IconConfiguration configuration;configuration.createMappings()
  • Smart code suggestions by Codota
}
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

  • Running tasks concurrently on multiple threads
  • getResourceAsStream (ClassLoader)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • getApplicationContext (Context)
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • JTextField (javax.swing)
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