• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java OneToOneRelationship类的典型用法和代码示例

java 2次浏览

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

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

示例1: shouldVisitEveryRelationship

点赞 3

import org.chalup.thneed.OneToOneRelationship; //导入依赖的package包/类
@Test
public void shouldVisitEveryRelationship() throws Exception {
  ModelGraph<ModelInterface> graph = ModelGraph.of(ModelInterface.class)
      .identifiedByDefault().by(_ID)
      .where()
      .the(LEAD).mayHave(CONTACT_DATA).linked().by(LEAD_ID)
      .build();

  graph.accept(mockVisitor);

  verify(mockVisitor).visit(captor.capture());
  OneToOneRelationship<ModelInterface> relationship = captor.getValue();
  assertThat(relationship.mModel).isEqualTo(LEAD);
  assertThat(relationship.mLinkedModel).isEqualTo(CONTACT_DATA);
  assertThat(relationship.mLinkedByColumn).isEqualTo(LEAD_ID);
  assertThat(relationship.mParentModelIdColumn).isEqualTo(_ID);
}
 

开发者ID:chalup,
项目名称:thneed,
代码行数:18,
代码来源:OneToOneTest.java

示例2: shouldUseRelationshipSpecificIdColumn

点赞 2

import org.chalup.thneed.OneToOneRelationship; //导入依赖的package包/类
@Test
public void shouldUseRelationshipSpecificIdColumn() throws Exception {
  ModelGraph<ModelInterface> graph = ModelGraph.of(ModelInterface.class)
      .identifiedByDefault().by(_ID)
      .where()
      .the(LEAD).identified().by(ID).mayHave(CONTACT_DATA).linked().by(LEAD_ID)
      .build();

  graph.accept(mockVisitor);

  verify(mockVisitor).visit(captor.capture());
  OneToOneRelationship<ModelInterface> relationship = captor.getValue();
  assertThat(relationship.mParentModelIdColumn).isEqualTo(ID);
}
 

开发者ID:chalup,
项目名称:thneed,
代码行数:15,
代码来源:OneToOneTest.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)