本文整理汇总了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());
}
示例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()));
}
示例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();
}
示例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()));
}
示例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();
}
示例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);
}
示例7: update
import net.java.ao.EntityManager; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void update(EntityManager entityManager) throws Exception {
entityManager.migrate(DisapprovalConfiguration.class, PullRequestDisapproval.class);
}
示例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);
}