当前位置: 首页>>代码示例>>Java>>正文


Java DatabasePlatform类代码示例

本文整理汇总了Java中org.eclipse.persistence.internal.databaseaccess.DatabasePlatform的典型用法代码示例。如果您正苦于以下问题:Java DatabasePlatform类的具体用法?Java DatabasePlatform怎么用?Java DatabasePlatform使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DatabasePlatform类属于org.eclipse.persistence.internal.databaseaccess包,在下文中一共展示了DatabasePlatform类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: entityManagerFactoryBean

import org.eclipse.persistence.internal.databaseaccess.DatabasePlatform; //导入依赖的package包/类
/**
     * EntityManager configuration.
     */
    @Bean(name = "entityManagerFactory")
    public LocalContainerEntityManagerFactoryBean entityManagerFactoryBean() {
        final LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
        em.setDataSource(getDatasource());
        em.setJpaDialect(jpaDialect());
        em.setPackagesToScan(entityManagerProperties.getPackagesToScan());
        em.setPersistenceUnitName(eclipseLinkProperties.getPersistenceUnitName());
        final DatabasePlatform dp = new MySQLPlatform();
        em.setJpaVendorAdapter(getEclipseLinkJpaVendorAdapter());

        //following code will be used for static weaving. Uncomment when creating war.
		final Map<String, String> propMap = new HashMap<String, String>();
		propMap.put("eclipselink.weaving", eclipseLinkProperties.getWeaving());
		em.setJpaPropertyMap(propMap);

//        em.setLoadTimeWeaver(loadTimeWeaver()); //comment this when using static weaving. Mostly in development environment inside eclipse
        return em;
    }
 
开发者ID:JonkiPro,项目名称:REST-Web-Services,代码行数:22,代码来源:WebDatasourceConfig.java

示例2: buildForeignKeyConstraint

import org.eclipse.persistence.internal.databaseaccess.DatabasePlatform; //导入依赖的package包/类
/**
 * Build a foreign key constraint using
 * FieldDefinition.getForeignKeyFieldName().
 */
@Override
protected ForeignKeyConstraint buildForeignKeyConstraint(FieldDefinition field, DatabasePlatform platform) {
    Vector sourceFields = new Vector();
    Vector targetFields = new Vector();
    ForeignKeyConstraint fkConstraint = new ForeignKeyConstraint();
    DatabaseField tempTargetField = new DatabaseField(field.getForeignKeyFieldName());
    DatabaseField tempSourceField = new DatabaseField(field.getName());

    sourceFields.add(tempSourceField.getName());
    targetFields.add(tempTargetField.getName());

    fkConstraint.setSourceFields(sourceFields);
    fkConstraint.setTargetFields(targetFields);
    fkConstraint.setTargetTable(tempTargetField.getTable().getQualifiedNameDelimited(platform));
    String tempName = buildForeignKeyConstraintName(this.getName(), tempSourceField.getName(), platform.getMaxForeignKeyNameSize(), platform);

    fkConstraint.setName(tempName);
    return fkConstraint;
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:24,代码来源:JPAMTableDefinition.java

示例3: buildUniqueKeyConstraint

import org.eclipse.persistence.internal.databaseaccess.DatabasePlatform; //导入依赖的package包/类
@Override
public UniqueKeyConstraint buildUniqueKeyConstraint(String name, List<String> fieldNames, int serialNumber, DatabasePlatform platform) {
    assert fieldNames.size() > 0;
    
    UniqueKeyConstraint unqConstraint = new UniqueKeyConstraint();
    
    for (String fieldName : fieldNames) {
        unqConstraint.addSourceField(fieldName);
    }
    
    // If the name was not provided, default one, otherwise use the name provided.
    if (name == null || name.equals("")) {
        unqConstraint.setName(buildUniqueKeyConstraintName(getName(), serialNumber, platform.getMaxUniqueKeyNameSize()));
    } else {
        // Hack if off if it exceeds the max size.
        if (name.length() > platform.getMaxUniqueKeyNameSize()) {
            unqConstraint.setName(name.substring(0, platform.getMaxUniqueKeyNameSize() - 1));
        } else {
            unqConstraint.setName(name);
        }
    }
    
    return unqConstraint;
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:25,代码来源:JPAMTableDefinition.java

示例4: JPAMDefaultTableGenerator

import org.eclipse.persistence.internal.databaseaccess.DatabasePlatform; //导入依赖的package包/类
/**
 * Default constructor
 */
public JPAMDefaultTableGenerator(Project project) {
    this.project = project;
    if (project.getDatasourceLogin().getDatasourcePlatform() instanceof DatabasePlatform) {
        this.databasePlatform = (DatabasePlatform) project.getDatasourceLogin().getDatasourcePlatform();
        this.generateFKConstraints = this.databasePlatform.supportsForeignKeyConstraints();
    }
    this.tableMap = new LinkedHashMap();
    this.fieldMap = new LinkedHashMap();
    this.databaseFields = new LinkedHashMap();
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:14,代码来源:JPAMDefaultTableGenerator.java

示例5: onConnect

import org.eclipse.persistence.internal.databaseaccess.DatabasePlatform; //导入依赖的package包/类
public void onConnect() {
    if(this.table.getName().length() == 0) {
        this.table.setName(((DatabasePlatform)getDatasourcePlatform()).getDefaultSequenceTableName());
    }
    super.onConnect();
}
 
开发者ID:jmrunge,项目名称:osiris-platform,代码行数:7,代码来源:TableSequence.java


注:本文中的org.eclipse.persistence.internal.databaseaccess.DatabasePlatform类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。