我对"懒惰加载"有一个疑问.使用@LazyCollection(LazyCollectionOption.FALSE)和有@OneToMany(fetch = FetchType.EAGER)什么区别 ?
在我的应用程序中,我使用两个列表,但如果我使用这种格式:
@OneToMany(mappedBy = "consultaSQL", orphanRemoval = true, fetch = FetchType.EAGER,
cascade = CascadeType.ALL)
private List<ParametroSQL> parametros;
@OneToMany(mappedBy = "consulta", orphanRemoval = true, fetch = FetchType.EAGER,
cascade = CascadeType.ALL)
private List<Contato> contatos;
Run Code Online (Sandbox Code Playgroud)
我有这个错误:
引起:org.hibernate.loader.MultipleBagFetchException:无法同时获取多个包
我知道这是因为Hibernate不允许我同时加载两个列表.但如果我使用这种格式:
@LazyCollection(LazyCollectionOption.FALSE)
@OneToMany(mappedBy = "consultaSQL", orphanRemoval = true,
cascade = CascadeType.ALL)
private List<ParametroSQL> parametros;
@LazyCollection(LazyCollectionOption.FALSE)
@OneToMany(mappedBy = "consulta", orphanRemoval = true,
cascade = CascadeType.ALL)
private List<Contato> contatos;
Run Code Online (Sandbox Code Playgroud)
它完美地运作.
对不起我的英文谢谢
我试图将 TextField 的标签放在正确的位置,但我不知道如何。文字没问题,但问题出在标签上。
TextField(
enabled: this.enable,
enableInteractiveSelection: false,
autofocus: false,
textAlign: TextAlign.right,
keyboardType: TextInputType.number,
decoration: InputDecoration(
labelText: this.label,
hintText: this.hint,
alignLabelWithHint: true,
errorText: snapshot.hasError ? snapshot.error : null),
obscureText: this.obscure,
controller: _controller,
);
Run Code Online (Sandbox Code Playgroud)
有人可以帮助我如何将 labelText 也放在右侧吗?