org.hibernate.cfg.Configuration.getProperty()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(186)

本文整理了Java中org.hibernate.cfg.Configuration.getProperty()方法的一些代码示例,展示了Configuration.getProperty()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.getProperty()方法的具体详情如下:
包路径:org.hibernate.cfg.Configuration
类名称:Configuration
方法名:getProperty

Configuration.getProperty介绍

[英]Get a property value by name
[中]按名称获取属性值

代码示例

代码示例来源:origin: Impetus/Kundera

String schemaProperty = conf.getProperty("hibernate.hbm2ddl.auto");
if (schemaProperty != null && (schemaProperty.equals("create") || schemaProperty.equals("create-drop")))

代码示例来源:origin: org.nuiton.topia/topia-persistence

/**
 * Return hibernate schema name
 *
 * @param config of hibernate
 * @return schema name
 */
public static String getSchemaName(Configuration config) {
  return config.getProperty(AvailableSettings.DEFAULT_SCHEMA);
}

代码示例来源:origin: jboss.jboss-embeddable-ejb3/hibernate-all

public void initialize(Configuration cfg){
   contextID = cfg.getProperty(Environment.JACC_CONTEXTID);
  }
}

代码示例来源:origin: jboss.jboss-embeddable-ejb3/hibernate-all

public void initialize(Configuration cfg){
   contextID = cfg.getProperty(Environment.JACC_CONTEXTID);
  }
}

代码示例来源:origin: jboss.jboss-embeddable-ejb3/hibernate-all

public void initialize(Configuration cfg){
   contextID = cfg.getProperty(Environment.JACC_CONTEXTID);
  }
}

代码示例来源:origin: jboss.jboss-embeddable-ejb3/hibernate-all

public void initialize(Configuration cfg){
   contextID = cfg.getProperty(Environment.JACC_CONTEXTID);
  }
}

代码示例来源:origin: org.jbpm.jbpm3/jbpm-jpdl

boolean getScript() {
 boolean script = false;
 String showSql = getConfiguration().getProperty(Environment.SHOW_SQL);
 if ("true".equalsIgnoreCase(showSql)) {
  script = true;
 }
 return script;
}

代码示例来源:origin: com.github.albfernandez/jbpm-jpdl

boolean getScript() {
 boolean script = false;
 String showSql = jbpmHibernateConfiguration.getConfigurationProxy().getProperty(Environment.SHOW_SQL);
 if ("true".equalsIgnoreCase(showSql)) {
  script = true;
 }
 return script;
}

代码示例来源:origin: org.ow2.bonita/bonita-server

public static String getIndexesDirectoryPath(final Configuration configuration) {
 if (disableSearchConfiguration(configuration)) {
  return null;
 } else {
  return configuration.getProperty("hibernate.search.default.indexBase");
 }
}

代码示例来源:origin: org.hibernatespatial/hibernate-spatial

/**
 * Derives the configuration from the Hibernate Configuration object.
 * 
 * @param hibernateConfig
 *            Hibernate Configuration object
 * @return true, if the configuration is successfull.
 */
public boolean configure(Configuration hibernateConfig) {
  String dialect = hibernateConfig.getProperty("hibernate.dialect");
  setProperty(HSProperty.DEFAULT_DIALECT, dialect);
  return true;
}

代码示例来源:origin: org.jbpm.jbpm3/jbpm-jpdl

public static boolean createSchemaExportScript(SessionFactory sessionFactory) {
 String showSql = getConfiguration(sessionFactory).getProperty("hibernate.show_sql");
 return "true".equalsIgnoreCase(showSql);
}

代码示例来源:origin: liquibase/liquibase-hibernate

@Override
protected String findDialectName() {
  String dialectName = super.findDialectName();
  if (dialectName == null) {
    dialectName = configuration.getProperty(AvailableSettings.DIALECT);
  }
  return dialectName;
}

代码示例来源:origin: dhis2/dhis2-core

public void init()
{
  Configuration hibernateConfiguration = hibernateConfigurationProvider.getConfiguration();
  
  String dialect = hibernateConfiguration.getProperty( KEY_DIALECT );
  statementDialect = dialectMap.get( dialect );
  
  if ( statementDialect == null )
  {
    throw new RuntimeException( "Unsupported dialect: " + dialect );
  }
}

代码示例来源:origin: com.github.albfernandez/jbpm-jpdl

public static boolean createSchemaExportScript(SessionFactory sessionFactory) {
 String showSql = getConfiguration(sessionFactory).getProperty("hibernate.show_sql");
 return "true".equalsIgnoreCase(showSql);
}

代码示例来源:origin: org.ow2.bonita/bonita-server

private static void addInterceptor(final Configuration configuration) {
 final String interceptorClassName = configuration.getProperty("bonita.hibernate.interceptor");
 if (interceptorClassName != null) {
  if (LOG.isLoggable(Level.INFO)) {
   LOG.info("Adding interceptor: " + interceptorClassName);
  }
  final Class<?> interceptorClass = ReflectUtil.loadClass(Thread.currentThread().getContextClassLoader(),
    interceptorClassName);
  final EmptyInterceptor interceptor = (EmptyInterceptor) ReflectUtil.newInstance(interceptorClass);
  configuration.setInterceptor(interceptor);
 }
}

代码示例来源:origin: uk.ac.ebi.intact/intact-core

private static UserContext createDefaultUserContext( IntactSession session ) {
  if ( log.isDebugEnabled() ) {
    log.debug( "Creating UserContext..." );
  }
  AbstractHibernateDataConfig defaultDataConfig = ( AbstractHibernateDataConfig ) RuntimeConfig.getCurrentInstance( session ).getDefaultDataConfig();
  Configuration configuration = defaultDataConfig.getConfiguration();
  //configuration.configure();
  String currentUser = configuration.getProperty( Environment.USER );
  String password = configuration.getProperty( Environment.PASS );
  UserContext userContext = new UserContext( currentUser, password );
  return userContext;
}

代码示例来源:origin: robeio/robe

@Override
protected void configure(Configuration configuration, ServiceRegistry registry) {
  String prefix = configuration.getProperty("hibernate.prefix");
  if (prefix != null) {
    configuration.setPhysicalNamingStrategy(new RobeHibernateNamingStrategy(prefix));
    LOGGER.info("Table Prefix: ", prefix);
  }
}

代码示例来源:origin: dhis2/dhis2-core

@Override
public String getObject()
  throws Exception
{
  String value = hibernateConfigurationProvider.getConfiguration().getProperty( hibernateProperty );
  
  return StringUtils.defaultIfEmpty( value, defaultValue );
}

代码示例来源:origin: org.jbpm.jbpm3/jbpm-jpdl

protected String getHibernateDialect() {
 DbPersistenceServiceFactory persistenceServiceFactory = (DbPersistenceServiceFactory) jbpmContext.getServiceFactory(Services.SERVICENAME_PERSISTENCE);
 return persistenceServiceFactory.getConfiguration().getProperty(Environment.DIALECT);
}

代码示例来源:origin: com.github.albfernandez/jbpm-jpdl

protected String getHibernateDialect() {
 DbPersistenceServiceFactory persistenceServiceFactory = (DbPersistenceServiceFactory) jbpmContext.getServiceFactory(Services.SERVICENAME_PERSISTENCE);
 return persistenceServiceFactory.getJbpmHibernateConfiguration().getConfigurationProxy().getProperty(Environment.DIALECT);
}

相关文章

Configuration类方法