@SequenceGenerator(name="seqGenDoc",initialValue=1)
public class GeneratedDocument implements Serializable{
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="seqGenDoc")
private long id;
private String label;
private String path;
@ManyToOne
@JoinColumn(name="CODE_USER_GENERATEDBY")
private User generatedBy;
private float version;
//@Temporal(TemporalType.DATE)
private Instant creationDate;
@OneToMany(mappedBy="documentGenerated",fetch=FetchType.LAZY)
private Collection<GeneratedDocumentFields> listDocFields;
@OneToMany(mappedBy="generatedDocument",fetch=FetchType.LAZY)
private Collection<HistoryDocument> listHistoryDoc;
公共接口GeneratedDocumentRepository扩展了JpaRepository {
@Query("select gd from GeneratedDocument gd left join fetch gd.generatedBy gb where gb.id=:x")
public List<GeneratedDocument> ListGenDocByUser(@Param("x")Long id);
} 该怎么办?