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


Java EntityManager.migrate方法代码示例

本文整理汇总了Java中net.java.ao.EntityManager.migrate方法的典型用法代码示例。如果您正苦于以下问题:Java EntityManager.migrate方法的具体用法?Java EntityManager.migrate怎么用?Java EntityManager.migrate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.java.ao.EntityManager的用法示例。


在下文中一共展示了EntityManager.migrate方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: update

import net.java.ao.EntityManager; //导入方法依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public void update(EntityManager entityManager) throws Exception {
    entityManager.migrate(WebHookConfiguration.class);

    entityManager.create(WebHookConfiguration.class, ImmutableMap.<String, Object>builder()
            .put(COLUMN_ENABLED, true)
            .put(COLUMN_REPO_ID, 1)
            .put(COLUMN_TITLE, "Jenkins")
            .put(COLUMN_URL, "https://example.com/jenkins/webhook")
            .build());

    entityManager.create(WebHookConfiguration.class, ImmutableMap.<String, Object>builder()
            .put(COLUMN_ENABLED, true)
            .put(COLUMN_REPO_ID, 2)
            .put(COLUMN_TITLE, "HipChat")
            .put(COLUMN_URL, "https://example.com/hipchat/webhook")
            .build());
    entityManager.create(WebHookConfiguration.class, ImmutableMap.<String, Object>builder()
            .put(COLUMN_ENABLED, false)
            .put(COLUMN_REPO_ID, 2)
            .put(COLUMN_TITLE, "Slack")
            .put(COLUMN_URL, "https://example.com/slack/webhook")
            .build());
}
 
开发者ID:Eernie,项目名称:bitbucket-webhooks-plugin,代码行数:26,代码来源:WebHookConfigurationDatabaseUpdater.java

示例2: update

import net.java.ao.EntityManager; //导入方法依赖的package包/类
@Override
public void update(EntityManager em) throws Exception {
    em.migrate(SshKeyEntity.class);

    // create an expired and non-expired ID.
    // Also create a BYPASS ID so that all types are present
    // IMPORTANT - only use APPROVED_PUBLIC_KEY to make sure validation rules dont allow UNAPPROVED key in test sabove
    DateTime now = new DateTime();
    expiredKey = em.create(SshKeyEntity.class, new DBParam("USERID", EXPIRED_USER_ID), new DBParam("KEYID",
            EXPIRED_STASH_KEY_ID), new DBParam("TEXT", APPROVED_PUBLIC_KEY_ONE), new DBParam("LABEL", "COMPROMISED"), new DBParam("TYPE", KeyType.USER),
            new DBParam("CREATED", now.minusDays(DAYS_ALLOWED+1).toDate()));

    validKey = em.create(SshKeyEntity.class, new DBParam("USERID", VALID_USER_ID), new DBParam("KEYID",
                    VALID_STASH_KEY_ID), new DBParam("TEXT", APPROVED_PUBLIC_KEY_ONE), new DBParam("LABEL", "VALID"), new DBParam("TYPE", KeyType.USER),
            new DBParam("CREATED",  now.minusDays(DAYS_ALLOWED-1).toDate()));


    SshKeyEntity bypassKey = em.create(SshKeyEntity.class, new DBParam("USERID", VALID_USER_ID), new DBParam("KEYID",
                    VALID_BYPASS_KEY_ID), new DBParam("TEXT", APPROVED_PUBLIC_KEY_ONE), new DBParam("LABEL", "BYPASS"), new DBParam("TYPE", KeyType.BYPASS),
            new DBParam("CREATED",  now.minusDays(DAYS_ALLOWED-1).toDate()));

}
 
开发者ID:libertymutual,项目名称:ssh-key-enforcer-stash,代码行数:23,代码来源:EnterpriseSshKeyManagerImplTest.java

示例3: update

import net.java.ao.EntityManager; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void update(EntityManager entityManager) throws Exception {
    entityManager.migrate(JenkinsServerConfiguration.class,
        RepositoryConfiguration.class, PullRequestMetadata.class, JobTypeStatusMapping.class);

    RepositoryConfiguration rc = entityManager.create(
        RepositoryConfiguration.class, new DBParam("REPO_ID",
            new Integer(10)));

    rc.setCiEnabled(true);
    rc.setPublishBranchRegex("publishBranchRegex");
    rc.setPublishBuildCommand("publishBuildCommand");
    rc.setVerifyBranchRegex("verifyBranchRegex");
    rc.setVerifyBuildCommand("verifyBuildCommand");
    rc.save();
}
 
开发者ID:palantir,项目名称:stashbot,代码行数:18,代码来源:ConfigurationTest.java

示例4: update

import net.java.ao.EntityManager; //导入方法依赖的package包/类
@Override
public void update(EntityManager em) throws Exception {
    em.migrate(SshKeyEntity.class);

   
    DateTime now = new DateTime();
    // create a pre-expired user key in DB 
    expiredUserKey = em.create(SshKeyEntity.class, new DBParam("TYPE", KeyType.USER), new DBParam("USERID",
            ADMIN_ID), new DBParam("TEXT", PUBLIC_KEY_ONE), new DBParam("LABEL", "COMPROMISED"), new DBParam(
            "CREATED", now.minusDays(DAYS_ALLOWED_FOR_USERS + 1).toDate()));

    // create a pre-expired bamboo key
    expiredBambooKey = em.create(SshKeyEntity.class, new DBParam("USERID", ADMIN_ID), new DBParam("TEXT",
            PUBLIC_KEY_ONE), new DBParam("LABEL", "BAMBOO"), new DBParam("TYPE", KeyType.BAMBOO), new DBParam(
            "CREATED", now.minusDays(DAYS_ALLOWED_FOR_BAMBOO + 1).toDate()));
    
    // create a non-expired user key in DB 
    validUserKey = em.create(SshKeyEntity.class, new DBParam("TYPE", KeyType.USER), new DBParam("USERID",
            USER_ID), new DBParam("TEXT", PUBLIC_KEY_ONE), new DBParam("LABEL", "COMPROMISED"), new DBParam(
            "CREATED", now.minusDays(DAYS_ALLOWED_FOR_USERS - 1).toDate()));

    // create a babmoo key that is older then user limit, but valid to bamboo limit
    validBambooKey = em.create(SshKeyEntity.class, new DBParam("USERID", USER_ID), new DBParam("TEXT",
            PUBLIC_KEY_ONE), new DBParam("LABEL", "BAMBOO"), new DBParam("TYPE", KeyType.BAMBOO), new DBParam(
            "CREATED", now.minusDays(DAYS_ALLOWED_FOR_BAMBOO - 1).toDate()));

}
 
开发者ID:libertymutual,项目名称:ssh-key-enforcer-stash,代码行数:28,代码来源:EnterpriseSshKeyRepositoryTest.java

示例5: update

import net.java.ao.EntityManager; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void update(EntityManager entityManager) throws Exception {
    // create some repo config
    entityManager.migrate(RepositoryConfiguration.class);
    RepositoryConfiguration rc = entityManager.create(
        RepositoryConfiguration.class, new DBParam("REPO_ID",
            new Integer(10)));

    rc.setCiEnabled(true);
    rc.setPublishBranchRegex("publishBranchRegex");
    rc.setPublishBuildCommand("publishBuildCommand");
    rc.setVerifyBranchRegex("verifyBranchRegex");
    rc.setVerifyBuildCommand("verifyBuildCommand");
    rc.save();

    RepositoryConfiguration rc2 = entityManager.create(
        RepositoryConfiguration.class, new DBParam("REPO_ID",
            new Integer(11)));

    rc2.setCiEnabled(false);
    rc2.setPublishBranchRegex("publishBranchRegex");
    rc2.setPublishBuildCommand("publishBuildCommand");
    rc2.setVerifyBranchRegex("verifyBranchRegex");
    rc2.setVerifyBuildCommand("verifyBuildCommand");
    rc2.save();
}
 
开发者ID:palantir,项目名称:stashbot,代码行数:28,代码来源:ConfigurationUpgradeV2Test.java

示例6: update

import net.java.ao.EntityManager; //导入方法依赖的package包/类
@Override
public void update(EntityManager entityManager) throws Exception {
    entityManager.migrate(UserAO.class, RoleAO.class, RoleToPermissionAO.class, PermissionAO.class, ForumAO.class, ThreadAO.class, AttachmentAO.class, PostAO.class, StateAO.class);
}
 
开发者ID:confluence-fourum,项目名称:Fourum-Plugin,代码行数:5,代码来源:AOTestDatabaseUpdater.java

示例7: update

import net.java.ao.EntityManager; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void update(EntityManager entityManager) throws Exception {
    entityManager.migrate(DisapprovalConfiguration.class, PullRequestDisapproval.class);
}
 
开发者ID:palantir,项目名称:stash-disapproval-plugin,代码行数:6,代码来源:PersistenceManagerTest.java

示例8: update

import net.java.ao.EntityManager; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void update(EntityManager entityManager) throws Exception {
    entityManager.migrate(JobTemplate.class, JobMapping.class,
        RepositoryConfiguration.class, JobTypeStatusMapping.class);
}
 
开发者ID:palantir,项目名称:stashbot,代码行数:7,代码来源:JenkinsJobTest.java


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