本文整理汇总了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)
);
}
示例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);
}
}
示例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());
}
示例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());
}
示例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"));
}
示例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());
}
}
示例7: getEntityType
import net.java.ao.RawEntity; //导入依赖的package包/类
@Override
public <X extends RawEntity<Integer>> Class<X> getEntityType()
{
return (Class<X>) DummyWebHookConfiguration.class;
}
示例8: getName
import net.java.ao.RawEntity; //导入依赖的package包/类
@Override
public String getName(Class<? extends RawEntity<?>> clazz)
{
return delegate.getName(clazz);
}
示例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;
}
示例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;
}
示例11: getEntityAlias
import net.java.ao.RawEntity; //导入依赖的package包/类
/**
* @param entity
* @return alias of entity
*/
String getEntityAlias(Class<? extends RawEntity<?>> entity);
示例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)));
}
示例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);
}