org.hibernate.annotations.TypeDef.parameters()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(3.6k)|赞(0)|评价(0)|浏览(214)

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

TypeDef.parameters介绍

暂无

代码示例

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

private static void bindTypeDef(TypeDef defAnn, MetadataBuildingContext context) {
  Properties params = new Properties();
  for ( Parameter param : defAnn.parameters() ) {
    params.setProperty( param.name(), param.value() );

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

private static void bindTypeDef(TypeDef defAnn, ExtendedMappings mappings) {
  Properties params = new Properties();
  for ( Parameter param : defAnn.parameters() ) {
    params.setProperty( param.name(), param.value() );
  }
  if ( BinderHelper.isDefault( defAnn.name() ) && defAnn.defaultForType().equals( void.class ) ) {
    throw new AnnotationException(
        "Either name or defaultForType (or both) attribute should be set in TypeDef having typeClass " +
            defAnn.typeClass().getName()
    );
  }
  if ( !BinderHelper.isDefault( defAnn.name() ) ) {
    log.info( "Binding type definition: {}", defAnn.name() );
    mappings.addTypeDef( defAnn.name(), defAnn.typeClass().getName(), params );
  }
  if ( !defAnn.defaultForType().equals( void.class ) ) {
    log.info( "Binding type definition: {}", defAnn.defaultForType().getName() );
    mappings.addTypeDef( defAnn.defaultForType().getName(), defAnn.typeClass().getName(), params );
  }
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

private static void bindTypeDef(TypeDef defAnn, Mappings mappings) {
  Properties params = new Properties();
  for ( Parameter param : defAnn.parameters() ) {
    params.setProperty( param.name(), param.value() );
  }
  if ( BinderHelper.isEmptyAnnotationValue( defAnn.name() ) && defAnn.defaultForType().equals( void.class ) ) {
    throw new AnnotationException(
        "Either name or defaultForType (or both) attribute should be set in TypeDef having typeClass " +
            defAnn.typeClass().getName()
    );
  }
  final String typeBindMessageF = "Binding type definition: %s";
  if ( !BinderHelper.isEmptyAnnotationValue( defAnn.name() ) ) {
    if ( LOG.isDebugEnabled() ) {
      LOG.debugf( typeBindMessageF, defAnn.name() );
    }
    mappings.addTypeDef( defAnn.name(), defAnn.typeClass().getName(), params );
  }
  if ( !defAnn.defaultForType().equals( void.class ) ) {
    if ( LOG.isDebugEnabled() ) {
      LOG.debugf( typeBindMessageF, defAnn.defaultForType().getName() );
    }
    mappings.addTypeDef( defAnn.defaultForType().getName(), defAnn.typeClass().getName(), params );
  }
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

private static void bindTypeDef(TypeDef defAnn, Mappings mappings) {
  Properties params = new Properties();
  for ( Parameter param : defAnn.parameters() ) {
    params.setProperty( param.name(), param.value() );
  }
  if ( BinderHelper.isEmptyAnnotationValue( defAnn.name() ) && defAnn.defaultForType().equals( void.class ) ) {
    throw new AnnotationException(
        "Either name or defaultForType (or both) attribute should be set in TypeDef having typeClass " +
            defAnn.typeClass().getName()
    );
  }
  final String typeBindMessageF = "Binding type definition: %s";
  if ( !BinderHelper.isEmptyAnnotationValue( defAnn.name() ) ) {
    if ( LOG.isDebugEnabled() ) {
      LOG.debugf( typeBindMessageF, defAnn.name() );
    }
    mappings.addTypeDef( defAnn.name(), defAnn.typeClass().getName(), params );
  }
  if ( !defAnn.defaultForType().equals( void.class ) ) {
    if ( LOG.isDebugEnabled() ) {
      LOG.debugf( typeBindMessageF, defAnn.defaultForType().getName() );
    }
    mappings.addTypeDef( defAnn.defaultForType().getName(), defAnn.typeClass().getName(), params );
  }
}

代码示例来源:origin: org.hibernate.orm/hibernate-core

private static void bindTypeDef(TypeDef defAnn, MetadataBuildingContext context) {
  Properties params = new Properties();
  for ( Parameter param : defAnn.parameters() ) {
    params.setProperty( param.name(), param.value() );

相关文章