本文整理汇总了Java中net.java.ao.EntityManager类的典型用法代码示例。如果您正苦于以下问题:Java EntityManager类的具体用法?Java EntityManager怎么用?Java EntityManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EntityManager类属于net.java.ao包,在下文中一共展示了EntityManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: getEntityManager
import net.java.ao.EntityManager; //导入依赖的package包/类
@Override
public EntityManager getEntityManager()
{
throw new IllegalArgumentException("Method not implemented");
}
示例7: BranchAOPopulator
import net.java.ao.EntityManager; //导入依赖的package包/类
public BranchAOPopulator(final EntityManager entityManager)
{
super(entityManager);
}
示例8: ChangesetAOPopulator
import net.java.ao.EntityManager; //导入依赖的package包/类
public ChangesetAOPopulator(final EntityManager entityManager)
{
super(entityManager);
}
示例9: AOPopulator
import net.java.ao.EntityManager; //导入依赖的package包/类
public AOPopulator(final EntityManager entityManager)
{
this.entityManager = entityManager;
}
示例10: RepositoryAOPopulator
import net.java.ao.EntityManager; //导入依赖的package包/类
public RepositoryAOPopulator(final EntityManager entityManager)
{
super(entityManager);
}
示例11: TestConnectionProvider
import net.java.ao.EntityManager; //导入依赖的package包/类
public TestConnectionProvider(final EntityManager entityManager)
{
this.entityManager = entityManager;
}
示例12: PullRequestAOPopulator
import net.java.ao.EntityManager; //导入依赖的package包/类
public PullRequestAOPopulator(final EntityManager entityManager)
{
super(entityManager);
}
示例13: OrganizationAOPopulator
import net.java.ao.EntityManager; //导入依赖的package包/类
public OrganizationAOPopulator(final EntityManager entityManager)
{
super(entityManager);
}
示例14: getEntityManager
import net.java.ao.EntityManager; //导入依赖的package包/类
@Override
public EntityManager getEntityManager()
{
return null;
}
示例15: 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);
}