congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
org.hibernate.cfg
Code IndexAdd Tabnine to your IDE (free)

How to use org.hibernate.cfg

Best Java code snippets using org.hibernate.cfg (Showing top 20 results out of 1,737)

origin: hibernate/hibernate-orm

/**
 * Adds the AttributeConverter Class to this Configuration.
 *
 * @param attributeConverterClass The AttributeConverter class.
 * @param autoApply Should the AttributeConverter be auto applied to property types as specified
 * by its "entity attribute" parameterized type?
 */
public void addAttributeConverter(Class<? extends AttributeConverter> attributeConverterClass, boolean autoApply) {
  addAttributeConverter( AttributeConverterDefinition.from( attributeConverterClass, autoApply ) );
}
origin: hibernate/hibernate-orm

public void addProperty(Property prop, Ejb3Column[] columns, XClass declaringClass) {
  //Ejb3Column.checkPropertyConsistency( ); //already called earlier
  if ( columns != null && columns[0].isSecondary() ) {
    //TODO move the getJoin() code here?
    final Join join = columns[0].getJoin();
    addPropertyToJoin( prop, declaringClass, join );
  }
  else {
    addProperty( prop, declaringClass );
  }
}
origin: hibernate/hibernate-orm

  /**
   * useful to override a column either by @MapsId or by @IdClass
   */
  Ejb3Column[] buildExcplicitOrDefaultJoinColumn(PropertyData overridingProperty) {
    Ejb3Column[] result;
    result = buildExplicitJoinColumns( overridingProperty.getProperty(), overridingProperty );
    if (result == null) {
      result = buildDefaultJoinColumnsForXToOne( overridingProperty.getProperty(), overridingProperty);
    }
    return result;
  }
}
origin: hibernate/hibernate-orm

  private Configuration buildBaseConfiguration() {
    return new Configuration()
        .addResource( "org/hibernate/test/stats/Continent.hbm.xml" )
        .setProperty( AvailableSettings.GENERATE_STATISTICS, "true" );
  }
//
origin: hibernate/hibernate-orm

@Override
public void configure(Configuration cfg) {
  cfg.setProperty(Environment.USE_SECOND_LEVEL_CACHE, "false");
  cfg.setProperty(Environment.GENERATE_STATISTICS, "true");
}
origin: hibernate/hibernate-orm

public String collectionTableName(
    String ownerEntity, String ownerEntityTable, String associatedEntity, String associatedEntityTable,
    String propertyName
) {
  return tableName( ownerEntityTable + '_' + propertyToColumnName(propertyName) );
}
origin: hibernate/hibernate-orm

public static String getReferenceEntityName(PropertyData propertyData, MetadataBuildingContext buildingContext) {
  XClass targetEntity = getTargetEntity( propertyData, buildingContext );
  if ( AnnotationBinder.isDefault( targetEntity, buildingContext ) ) {
    return propertyData.getClassOrElementName();
  }
  else {
    return targetEntity.getName();
  }
}
origin: hibernate/hibernate-orm

@Override
public Column[] getOverriddenColumn(String propertyName) {
  //FIXME this is yukky
  Column[] result = super.getOverriddenColumn( propertyName );
  if ( result == null ) {
    String userPropertyName = extractUserPropertyName( "id", propertyName );
    if ( userPropertyName != null ) result = super.getOverriddenColumn( userPropertyName );
  }
  if ( result == null ) {
    String userPropertyName = extractUserPropertyName( PropertyPath.IDENTIFIER_MAPPER_PROPERTY, propertyName );
    if ( userPropertyName != null ) result = super.getOverriddenColumn( userPropertyName );
  }
  return result;
}
origin: hibernate/hibernate-orm

@Override
public boolean isCollectionElement() {
  // if the propertyHolder is a collection, assume the
  // @Column refers to the element column
  return !propertyHolder.isComponent()
      && !propertyHolder.isEntity();
}
origin: hibernate/hibernate-orm

  @Override
  public <S extends X> SubGraphImplementor<S> makeSubGraph(Class<S> subType) {
    throw new NotYetImplementedException(  );
  }
}
origin: hibernate/hibernate-orm

  /**
   * must only be used on second level phases (<join> has to be settled already)
   */
  public static PropertyHolder buildPropertyHolder(
      PersistentClass persistentClass,
      Map<String, Join> joins,
      MetadataBuildingContext context,
      Map<XClass, InheritanceState> inheritanceStatePerClass) {
    return new ClassPropertyHolder( persistentClass, null, joins, context, inheritanceStatePerClass );
  }
}
origin: hibernate/hibernate-orm

AbstractPropertyHolder(
    String path,
    PropertyHolder parent,
    XClass clazzToProcess,
    MetadataBuildingContext context) {
  this.path = path;
  this.parent = (AbstractPropertyHolder) parent;
  this.context = context;
  buildHierarchyColumnOverride( clazzToProcess );
}
origin: spring-projects/spring-framework

/**
 * Overridden to reliably pass a {@link CurrentTenantIdentifierResolver} to the SessionFactory.
 * @since 4.3.2
 * @see AvailableSettings#MULTI_TENANT_IDENTIFIER_RESOLVER
 */
@Override
public void setCurrentTenantIdentifierResolver(CurrentTenantIdentifierResolver currentTenantIdentifierResolver) {
  getProperties().put(AvailableSettings.MULTI_TENANT_IDENTIFIER_RESOLVER, currentTenantIdentifierResolver);
  super.setCurrentTenantIdentifierResolver(currentTenantIdentifierResolver);
}
origin: hibernate/hibernate-orm

public void configure(Configuration cfg) {
  cfg.setProperty( Environment.USE_SECOND_LEVEL_CACHE, "true" );
  cfg.setProperty( Environment.USE_QUERY_CACHE, "true" );
  cfg.setProperty( Environment.GENERATE_STATISTICS, "true" );
}
origin: hibernate/hibernate-orm

/**
 * Adds the AttributeConverter Class to this Configuration.
 *
 * @param attributeConverterClass The AttributeConverter class.
 */
public void addAttributeConverter(Class<? extends AttributeConverter> attributeConverterClass) {
  addAttributeConverter( AttributeConverterDefinition.from( attributeConverterClass ) );
}
origin: hibernate/hibernate-orm

@Override
public void configure(Configuration cfg) {
  cfg.setProperty(
      Environment.HBM2DDL_IMPORT_FILES,
      "/org/hibernate/test/fileimport/humans.sql,/org/hibernate/test/fileimport/dogs.sql"
  );
}
origin: hibernate/hibernate-orm

/**
 * Adds the AttributeConverter instance to this Configuration.  This form is mainly intended for developers
 * to programmatically add their own AttributeConverter instance.  HEM, instead, uses the
 * {@link #addAttributeConverter(Class, boolean)} form
 *
 * @param attributeConverter The AttributeConverter instance.
 * @param autoApply Should the AttributeConverter be auto applied to property types as specified
 * by its "entity attribute" parameterized type?
 */
public void addAttributeConverter(AttributeConverter attributeConverter, boolean autoApply) {
  addAttributeConverter( AttributeConverterDefinition.from( attributeConverter, autoApply ) );
}
origin: hibernate/hibernate-orm

  @Override
  protected void configure(Configuration cfg) {
    cfg.setProperty( "hibernate.cache.use_query_cache", "true" );
  }
}
origin: hibernate/hibernate-orm

/**
 * Adds the AttributeConverter instance to this Configuration.  This form is mainly intended for developers
 * to programmatically add their own AttributeConverter instance.  HEM, instead, uses the
 * {@link #addAttributeConverter(Class, boolean)} form
 *
 * @param attributeConverter The AttributeConverter instance.
 */
public void addAttributeConverter(AttributeConverter attributeConverter) {
  addAttributeConverter( AttributeConverterDefinition.from( attributeConverter ) );
}
origin: hibernate/hibernate-orm

@Override
protected void configure(Configuration configuration) {
  configuration.setProperty( AvailableSettings.USE_SECOND_LEVEL_CACHE, "false" );
  configuration.setProperty( AvailableSettings.ENABLE_LAZY_LOAD_NO_TRANS, "true" );
}
org.hibernate.cfg

Most used classes

  • Configuration
    An instance of Configuration allows the application to specify properties and mapping documents to b
  • Settings
    Settings that affect the behaviour of Hibernate at runtime.
  • Environment
    Provides access to configuration info passed in Properties objects. Hibernate has two property scop
  • AnnotationConfiguration
    Similar to the Configuration object but handles EJB3 and Hibernate specific annotations as a metadat
  • ImprovedNamingStrategy
    An improved naming strategy that prefers embedded underscores to mixed case names
  • BinderHelper,
  • Mappings,
  • NamingStrategy,
  • DefaultComponentSafeNamingStrategy,
  • EJB3DTDEntityResolver,
  • XMLContext,
  • CollectionSecondPass,
  • DefaultNamingStrategy,
  • Ejb3Column,
  • PropertyHolder,
  • TableBinder,
  • AbstractPropertyHolder,
  • AccessType,
  • AnnotatedClassType
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