@Test public void getDivision_Found() { CommonCourtDivision testDivisionOne = commonCourt.getDivision(hashCodes[0]); CommonCourtDivision testDivisionTwo = commonCourt.getDivision(hashCodes[1]); assertNotNull(testDivisionOne); assertNotNull(testDivisionTwo); assertEquals(testDivisionOne, divisionMap.get(hashCodes[0])); assertEquals(testDivisionTwo, divisionMap.get(hashCodes[1])); }
@Transient public CommonCourtDivision getDivision(String divisionCode) { for (CommonCourtDivision division : getDivisions_()) { if (divisionCode.equals(division.getCode())) { return division; } } return null; }
CommonCourt extends DataObject { @Transient public CommonCourtDivision getDivision(String divisionCode) { for (CommonCourtDivision division : getDivisions_()) { if (divisionCode.equals(division.getCode())) { return division; } } return null; } }
CommonCourt extends DataObject { @Transient public CommonCourtDivision getDivision(String divisionCode) { for (CommonCourtDivision division : getDivisions_()) { if (divisionCode.equals(division.getCode())) { return division; } } return null; }  }
CommonCourt extends DataObject { @Transient public CommonCourtDivision getDivision(String divisionCode) { for (CommonCourtDivision division : getDivisions_()) { if (divisionCode.equals(division.getCode())) { return division; } } return null; }  @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seq_common_court") @Override long getId(); @Column(unique=true, nullable=false) String getCode(); String getName(); @Enumerated(EnumType.STRING) CommonCourtType getType(); @Transient List<CommonCourtDivision> getDivisions(); @ManyToOne(fetch=FetchType.LAZY) CommonCourt getParentCourt(); @Transient CommonCourtDivision getDivision(String divisionCode); boolean hasDivision(String divisionCode); @Transient void addDivision(CommonCourtDivision division); @Transient boolean isCommonCourtType(CommonCourtType type); @Transient boolean isAppealCourt(); @Transient boolean isRegionalCourt(); @Transient boolean isDistrictCourt(); @Transient CommonCourt getAppealCourt(); @Transient CommonCourt getRegionalCourt(); @Override void passVisitorDown(Visitor visitor); void setName(String name); void setCode(String code); void setType(CommonCourtType type); void setParentCourt(CommonCourt parentCourt); @Override int hashCode(); @Override boolean equals(Object obj); }
CommonCourt extends DataObject { @Transient public CommonCourtDivision getDivision(String divisionCode) { for (CommonCourtDivision division : getDivisions_()) { if (divisionCode.equals(division.getCode())) { return division; } } return null; }  @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seq_common_court") @Override long getId(); @Column(unique=true, nullable=false) String getCode(); String getName(); @Enumerated(EnumType.STRING) CommonCourtType getType(); @Transient List<CommonCourtDivision> getDivisions(); @ManyToOne(fetch=FetchType.LAZY) CommonCourt getParentCourt(); @Transient CommonCourtDivision getDivision(String divisionCode); boolean hasDivision(String divisionCode); @Transient void addDivision(CommonCourtDivision division); @Transient boolean isCommonCourtType(CommonCourtType type); @Transient boolean isAppealCourt(); @Transient boolean isRegionalCourt(); @Transient boolean isDistrictCourt(); @Transient CommonCourt getAppealCourt(); @Transient CommonCourt getRegionalCourt(); @Override void passVisitorDown(Visitor visitor); void setName(String name); void setCode(String code); void setType(CommonCourtType type); void setParentCourt(CommonCourt parentCourt); @Override int hashCode(); @Override boolean equals(Object obj);  }