Я создал свое приложение, используя JHipster.Когда я пытаюсь получить список турниров через TournamentQueryService, я получаю эту ошибку:
Исключение в TournamentQueryService.findByCriteria () с причиной = 'org.hibernate.HibernateException: невозможно получить доступ к потоку лобов' и исключением ='Невозможно получить доступ к потоку лобов;вложенное исключение: org.hibernate.HibernateException: невозможно получить доступ к потоку объектов '
Это фильтр и объект страницы:
найти по критериям: TournamentCriteria {}, страница:Запрос страницы [число: 0, размер 8, сортировка: startDate: DESC]
Таким образом, он просто получает 8 первых турниров.
Это турнирный класс:
@Entity
@Table(name = "tournament")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@Document(indexName = "tournament")
public class Tournament extends AbstractAuditingEntity implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
@SequenceGenerator(name = "sequenceGenerator")
private Long id;
@Column(name = "name")
private String name;
@Column(name = "location")
private String location;
@Column(name = "url")
private String url;
@Column(name = "start_date")
private ZonedDateTime startDate;
@Column(name = "end_date")
private ZonedDateTime endDate;
@Column(name = "entry_fee")
private Double entryFee;
@Column(name = "prize")
private Double prize;
@Column(name = "goods")
private String goods;
@Column(name = "favorite_rating")
private Long favoriteRating;
@Column(name = "participants_number")
private Integer participantsNumber;
@Column(name = "finished")
private Boolean finished;
@Column(name = "view_only")
private Boolean viewOnly;
@Column(name = "image")
private String image;
@Column(name = "description")
private String description;
@Column(name = "teams_applied")
private String teamsApplied;
@Lob
@Column(name = "schedule")
private String schedule;
@Lob
@Column(name = "prize_distribution")
private String prizeDistribution;
@Lob
@Column(name = "contacts")
private String contacts;
@Lob
@Column(name = "rules")
private String rules;
@OneToMany(mappedBy = "tournament", fetch = FetchType.LAZY)
@JsonIgnore
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
private Set<Stream> streams = new HashSet<>();
@ManyToMany(fetch = FetchType.EAGER)
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@JoinTable(name = "tournament_platforms", joinColumns = @JoinColumn(name = "tournaments_id", referencedColumnName = "id"), inverseJoinColumns = @JoinColumn(name = "platforms_id", referencedColumnName = "id"))
private Set<Platform> platforms = new HashSet<>();
@ManyToOne
private Game game;
@ManyToOne
private TournamentStatus status;
@ManyToOne(fetch = FetchType.LAZY)
private EntryType entryType;
@ManyToOne(fetch = FetchType.LAZY)
private TournamentFormat format;
@ManyToOne
private Region region;
@ManyToOne(fetch = FetchType.LAZY)
private GameMode gameMode;
@ManyToOne(fetch = FetchType.LAZY)
private PrizeType prizeType;
@ManyToOne
private Organizer organizer;
@ManyToOne(fetch = FetchType.LAZY)
private TournamentStage stage;
@ManyToOne
private HostPlatform hostPlatforms;
@ManyToOne(fetch = FetchType.LAZY)
private TournamentType type;
@ManyToOne
private PlayType playType;
@ManyToOne
private Currency currency;
@ManyToOne
private Country country;
Вот метод, который вызывает hibernate:
@Transactional(readOnly = true)
public Page<Tournament> findByCriteria(TournamentCriteria criteria, Pageable page) {
log.info("find by criteria : {}, page: {}", criteria, page);
final Specifications<Tournament> specification = createSpecification(criteria);
Page<Tournament> result = tournamentRepository.findAll(specification, page);
return result;
}