javax.persistence.Table.schema()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(251)

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

Table.schema介绍

暂无

代码示例

代码示例来源:origin: abel533/Mapper

public void setTable(Table table) {
    this.name = table.name();
    this.catalog = table.catalog();
    this.schema = table.schema();
  }
}

代码示例来源:origin: abel533/Mapper

public void setTable(Table table) {
    this.name = table.name();
    this.catalog = table.catalog();
    this.schema = table.schema();
  }
}

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

String schemaName = table.schema();
if (schemaName != null && schemaName.indexOf('@') > 0)

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

String schemaName = table.schema();
if (schemaName != null && schemaName.indexOf('@') > 0)

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

if ( table != null ) {
  annotation.setValue( "name", table.name() );
  annotation.setValue( "schema", table.schema() );
  annotation.setValue( "catalog", table.catalog() );
  annotation.setValue( "uniqueConstraints", table.uniqueConstraints() );

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

private void setSchemaAndPU(Class<?> clazz, EntityMetadata metadata)
  {
    Table table = clazz.getAnnotation(Table.class);
    if (table != null)
    {
//            log.debug("In set schema and pu, class is " + clazz.getName());
      // Set Name of persistence object
      metadata.setTableName(!StringUtils.isBlank(table.name()) ? 
           table.name() : clazz.getSimpleName());
      // Add named/native query related application metadata.
      addNamedNativeQueryMetadata(clazz);
      // set schema name and persistence unit name (if provided)
      String schemaStr = table.schema();

      MetadataUtils.setSchemaAndPersistenceUnit(metadata, schemaStr, puProperties);
    }
    if (metadata.getPersistenceUnit() == null)
    {
//            log.debug("In set schema and pu, pu is " + persistenceUnit);
      metadata.setPersistenceUnit(persistenceUnit);
    }
  }

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

schemaName = superClazzType.getJavaType().getAnnotation(Table.class).schema();

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

/**
 * Sets the schema and pu.
 *
 * @param clazz
 *            the clazz
 * @param metadata
 *            the metadata
 */
private static void setSchemaAndPU(Class<?> clazz, EntityMetadata metadata)
{
  Table table = clazz.getAnnotation(Table.class);
  if (table != null)
  {
    metadata.setTableName(!StringUtils.isBlank(table.name()) ? table.name() : clazz.getSimpleName());
    String schemaStr = table.schema();
    MetadataUtils.setSchemaAndPersistenceUnit(metadata, schemaStr,
        em.getEntityManagerFactory().getProperties());
  }
  else
  {
    metadata.setTableName(clazz.getSimpleName());
    metadata.setSchema((String) em.getEntityManagerFactory().getProperties().get("kundera.keyspace"));
  }
  if (metadata.getPersistenceUnit() == null)
  {
    metadata.setPersistenceUnit(getPersistenceUnit());
  }
}

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

/**
 * Gets the table name from annotation.
 */
protected TableName getTableNameFromAnnotation(Class<?> beanClass) {
 final Table t = AnnotationUtil.findAnnotationRecursive(beanClass, Table.class);
 // Take the annotation if defined
 if (t != null && !isEmpty(t.name())) {
  // Note: empty catalog and schema are converted to null
  // Only need to convert quoted identifiers from annotations
  return new TableName(quoteIdentifiers(t.catalog()), quoteIdentifiers(t.schema()), quoteIdentifiers(t.name()));
 }
 // No annotation
 return null;
}

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

tabAnn = clazzToProcess.getAnnotation( javax.persistence.Table.class );
table = tabAnn.name();
schema = tabAnn.schema();
catalog = tabAnn.catalog();
uniqueConstraints = TableBinder.buildUniqueConstraintHolders( tabAnn.uniqueConstraints() );

代码示例来源:origin: otaviojava/Easy-Cassandra

/**
 * return the chema looking to  class.
 * @param class1 the class
 * @return the schema
 */
public String getSchema(Class<?> class1) {
  Table columnFamily = (Table) class1.getAnnotation(Table.class);
  if (columnFamily != null) {
    return columnFamily.schema();
  }
  return "";
}

代码示例来源:origin: com.synaptix/SynaptixEntity

@Override
public IClassExtensionDescriptor createClassExtensionDescriptor(Class<? extends IComponent> componentClass) {
  IClassExtensionDescriptor classExtensionDescriptor = null;
  if (IComponent.class.isAssignableFrom(componentClass)) {
    Table entity = componentClass.getAnnotation(Table.class);
    if (entity != null) {
      classExtensionDescriptor = new DatabaseClassExtensionDescriptor(entity.schema(), entity.name());
    }
  }
  return classExtensionDescriptor;
}

代码示例来源:origin: com.github.abel533/mapper

public void setTable(Table table) {
  this.name = table.name();
  this.catalog = table.catalog();
  this.schema = table.schema();
}

代码示例来源:origin: tk.mybatis/mapper-core

public void setTable(Table table) {
    this.name = table.name();
    this.catalog = table.catalog();
    this.schema = table.schema();
  }
}

代码示例来源:origin: com.hand.hap.cloud/hap-mybatis-mapper-starter

public void setTable(Table table) {
  this.name = table.name();
  this.catalog = table.catalog();
  this.schema = table.schema();
}

代码示例来源:origin: com.ibeetl/beetlsql

protected void setTable(Table table) {
  name = table.name();
  if (StringKit.isNotBlank(table.schema())) {
    name = table.schema() + "." + name;
  } else if (StringKit.isNotBlank(table.catalog())) {
    name = table.catalog() + "." + name;
  }
}
protected void addProp(String col, String prop) {

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

if ( table != null ) {
  annotation.setValue( "name", table.name() );
  annotation.setValue( "schema", table.schema() );
  annotation.setValue( "catalog", table.catalog() );
  annotation.setValue( "uniqueConstraints", table.uniqueConstraints() );

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

javax.persistence.Table tabAnn = clazzToProcess.getAnnotation( javax.persistence.Table.class );
table = tabAnn.name();
schema = tabAnn.schema();
catalog = tabAnn.catalog();
uniqueConstraints = TableBinder.buildUniqueConstraintHolders( tabAnn.uniqueConstraints() );

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

/**
 * Set class table.
 */
private void parseTable(ClassMapping cm, Table table) {
  String tableName = toTableName(table.schema(), table.name());
  if (tableName != null)
    cm.getMappingInfo().setTableName(tableName);
  for (UniqueConstraint uniqueConstraint:table.uniqueConstraints()) {
    Unique unique = newUnique(cm, null, uniqueConstraint.columnNames());
    cm.getMappingInfo().addUnique(unique);
  }
}

代码示例来源:origin: org.apache.openjpa/openjpa-persistence-jdbc

/**
 * Set class table.
 */
private void parseTable(ClassMapping cm, Table table) {
  if (cm.isAbstract())
    throw new UserException(_loc.get("table-not-allowed", cm));
  DBIdentifier tName = toTableIdentifier(table.schema(), table.name());
  if (!DBIdentifier.isNull(tName)) {
    cm.getMappingInfo().setTableIdentifier(tName);
  }
  addUniqueConstraints(tName.getName(), cm, cm.getMappingInfo(),
    table.uniqueConstraints());
}

相关文章

微信公众号

最新文章

更多