Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Getter
- @Setter
- @ToString
- @Entity
- @Table(name = "TVSource")
- public class MyTelevisionSource {
- @Id
- private Long SourceId;
- @Column(columnDefinition = "nvarchar2 (2000)")
- private String LongName;
- @Column(columnDefinition = "nvarchar2 (2000)")
- private String DisplayName;
- @OneToOne(fetch=FetchType.LAZY)
- @JoinColumn(name = "SourceId")
- private RCMSource rcmSource;
- }
- @Getter
- @Setter
- @ToString
- @Entity
- @Table(name = "Source")
- public class RCMSource {
- @Id
- private Long SourceId;
- @Column(columnDefinition = "nvarchar2 (2000)")
- private String SourceName;
- }
- @Service
- public class TelevisionSourceService {
- @Autowired
- private TelevisionSourceRepository televisionSourceRepo;
- public List<MyTelevisionSource> getTelevisionSource(){
- Pageable pageable = PageRequest.of(0, 10);
- Page<MyTelevisionSource> tvSource = televisionSourceRepo.findAll(pageable);
- System.out.println(tvSource.getContent());
- return tvSource.getContent();
- }
- public interface TelevisionSourceRepository extends JpaRepository<MyTelevisionSource, Long> {
- Page<MyTelevisionSource> findAll(Pageable pageable);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement