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


Java RawEntity类代码示例

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


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

示例1: createInstanceOf

import net.java.ao.RawEntity; //导入依赖的package包/类
/**
 * Returns a new "beany" instance of the entity interface. By this I mean that the returned instances can be used as
 * a bean to set/get properties but all "active" methods like save() will throw UnsupportedOperationException.
 *
 * @param entityInterface an ActiveObjects entity interface
 * @return a new instance of {@code entityInterface}
 */
@SuppressWarnings ("unchecked")
public <T extends RawEntity> T createInstanceOf(Class<T> entityInterface)
{
    if (!entityInterface.isInterface())
    {
        throw new IllegalArgumentException("Expected an interface, got: " + entityInterface);
    }

    return (T) Proxy.newProxyInstance(
            getClass().getClassLoader(),
            new Class[] { entityInterface },
            new EntityBeanInterceptor(entityInterface)
    );
}
 
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:22,代码来源:EntityBeanGenerator.java

示例2: create

import net.java.ao.RawEntity; //导入依赖的package包/类
public <T extends RawEntity<K>, K> T create(Class<T> type, Map<String, Object> params)
{
    try
    {
        return entityManager.create(type, params);
    }
    catch (SQLException e)
    {
        throw new RuntimeException(e);
    }
}
 
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:12,代码来源:AOPopulator.java

示例3: testUpdatePullRequestIssueKeysShouldUpdateFromTitleAndSourceBranch

import net.java.ao.RawEntity; //导入依赖的package包/类
@Test
public void testUpdatePullRequestIssueKeysShouldUpdateFromTitleAndSourceBranch() throws Exception
{
    mockNewPRWithCommits("TITLE-1 title", "SRCBR-1-source-branch", "TEST-2", "TEST-3");
    mockExistingPRIssueKeyMappings("TEST-2", "TEST-3");

    assertThat(repositoryPullRequestDao.updatePullRequestIssueKeys(repository, REPO_ID), equalTo(4));
    verify(activeObjects).create(eq(RepositoryPullRequestIssueKeyMapping.class), matchMapHasIssueKey("TITLE-1"));
    verify(activeObjects).create(eq(RepositoryPullRequestIssueKeyMapping.class), matchMapHasIssueKey("SRCBR-1"));
    verify(activeObjects, never()).delete(org.mockito.Matchers.<RawEntity<?>[]>anyVararg());
}
 
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:12,代码来源:RepositoryPullRequestDaoImplTest.java

示例4: testUpdatePullRequestIssueKeysShouldAddNewIssueKeyFromCommits

import net.java.ao.RawEntity; //导入依赖的package包/类
@Test
public void testUpdatePullRequestIssueKeysShouldAddNewIssueKeyFromCommits() throws Exception
{
    mockNewPRWithCommits("TITLE-1 title", "SRCBR-1-source-branch", "TEST-1", "TEST-2", "TEST-3");
    mockExistingPRIssueKeyMappings("TEST-2", "TEST-3");

    assertThat(repositoryPullRequestDao.updatePullRequestIssueKeys(repository, REPO_ID), equalTo(5));
    verify(activeObjects).create(eq(RepositoryPullRequestIssueKeyMapping.class), matchMapHasIssueKey("TITLE-1"));
    verify(activeObjects).create(eq(RepositoryPullRequestIssueKeyMapping.class), matchMapHasIssueKey("SRCBR-1"));
    verify(activeObjects).create(eq(RepositoryPullRequestIssueKeyMapping.class), matchMapHasIssueKey("TEST-1"));
    verify(activeObjects, never()).delete(org.mockito.Matchers.<RawEntity<?>[]>anyVararg());
}
 
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:13,代码来源:RepositoryPullRequestDaoImplTest.java

示例5: testUpdatePullRequestIssueKeysShouldDeleteOutdatedIssueKeys

import net.java.ao.RawEntity; //导入依赖的package包/类
@Test
public void testUpdatePullRequestIssueKeysShouldDeleteOutdatedIssueKeys() throws Exception
{
    mockNewPRWithCommits("TITLE-1 title", "SRCBR-1-source-branch", "TEST-1", "TEST-2", "TEST-3");
    mockExistingPRIssueKeyMappings("TEST-2", "TEST-3", "TEST-4", "TEST-5");

    assertThat(repositoryPullRequestDao.updatePullRequestIssueKeys(repository, REPO_ID), equalTo(5));
    verify(activeObjects).create(eq(RepositoryPullRequestIssueKeyMapping.class), matchMapHasIssueKey("TITLE-1"));
    verify(activeObjects).create(eq(RepositoryPullRequestIssueKeyMapping.class), matchMapHasIssueKey("SRCBR-1"));
    verify(activeObjects).create(eq(RepositoryPullRequestIssueKeyMapping.class), matchMapHasIssueKey("TEST-1"));
    verify(activeObjects, times(2)).delete(org.mockito.Matchers.<RawEntity<?>[]>anyVararg());
    // the find used by delete
    verify(activeObjects).find(eq(RepositoryPullRequestIssueKeyMapping.class), matchQueryForPRIssueKeyWithIssueKey("TEST-4"));
    verify(activeObjects).find(eq(RepositoryPullRequestIssueKeyMapping.class), matchQueryForPRIssueKeyWithIssueKey("TEST-5"));
}
 
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:16,代码来源:RepositoryPullRequestDaoImplTest.java

示例6: buildAliases

import net.java.ao.RawEntity; //导入依赖的package包/类
/**
 * Builds aliases.
 * 
 * @param context
 *            query context
 */
private void buildAliases(QueryContext context)
{
    for (Entry<Class<? extends RawEntity<?>>, String> alias : aliases.entrySet())
    {
        context.getQuery().alias(alias.getKey(), alias.getValue());
    }
}
 
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:14,代码来源:QueryTemplate.java

示例7: getEntityType

import net.java.ao.RawEntity; //导入依赖的package包/类
@Override
public <X extends RawEntity<Integer>> Class<X> getEntityType()
{
	return (Class<X>) DummyWebHookConfiguration.class;
}
 
开发者ID:Eernie,项目名称:bitbucket-webhooks-plugin,代码行数:6,代码来源:DummyWebHookConfiguration.java

示例8: getName

import net.java.ao.RawEntity; //导入依赖的package包/类
@Override
public String getName(Class<? extends RawEntity<?>> clazz)
{
    return delegate.getName(clazz);
}
 
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:6,代码来源:DvcsConnectorTableNameConverter.java

示例9: QueryJoin

import net.java.ao.RawEntity; //导入依赖的package包/类
/**
 * Constructor.
 * 
 * @param entity
 *            joined entity
 * @param leftColumn
 *            left column of join
 * @param rightColumn
 *            right column of join
 */
public QueryJoin(Class<? extends RawEntity<?>> entity, QueryColumn leftColumn, QueryColumn rightColumn)
{
    this.entity = entity;
    this.leftColumn = leftColumn;
    this.rightColumn = rightColumn;
}
 
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:17,代码来源:QueryJoin.java

示例10: QueryColumn

import net.java.ao.RawEntity; //导入依赖的package包/类
/**
 * Constructor.
 * 
 * @param entity
 *            name of entity
 * @param columnName
 *            name of column
 */
public QueryColumn(Class<? extends RawEntity<?>> entity, String columnName)
{
    this.entity = entity;
    this.columnName = columnName;
}
 
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:14,代码来源:QueryColumn.java

示例11: getEntityAlias

import net.java.ao.RawEntity; //导入依赖的package包/类
/**
 * @param entity
 * @return alias of entity
 */
String getEntityAlias(Class<? extends RawEntity<?>> entity);
 
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:6,代码来源:QueryContext.java

示例12: join

import net.java.ao.RawEntity; //导入依赖的package包/类
/**
 * Joins provided entity.
 * 
 * @param entity
 *            to join
 * @param leftColumn
 *            on which column
 * @param rightColumn
 *            by which column
 */
protected void join(Class<? extends RawEntity<?>> entity, QueryColumn leftColumn, String rightColumn)
{
    joins.add(new QueryJoin(entity, leftColumn, column(entity, rightColumn)));
}
 
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:15,代码来源:QueryTemplate.java

示例13: column

import net.java.ao.RawEntity; //导入依赖的package包/类
/**
 * @param entity
 * @param columnName
 * @return {@link QueryColumn}
 */
protected QueryColumn column(Class<? extends RawEntity<?>> entity, String columnName)
{
    return new QueryColumn(entity, columnName);
}
 
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:10,代码来源:QueryTemplate.java


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