當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。