@AllArgsConstructor
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
@NoArgsConstructor
@ToString
public class ContaDTO {
@EqualsAndHashCode.Include
@Getter
@Setter
private String numero;
@EqualsAndHashCode.Include
@Getter
@Setter
private String agencia;
@Getter
@Setter
private List<Movimentacao> movimentacoes;
}
@AllArgsConstructor
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
@Entity
@NoArgsConstructor
@Table(name = "CONTA")
@ToString
public class Conta {
@Column(name = "ID")
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@EqualsAndHashCode.Include
@Getter
@Setter
private Long id;
@Column(name = "TITULAR")
@Getter
@Setter
private String titular;
@Column(name = "BANCO")
@Getter
@Setter
private String banco;
@Column(name = "NUMERO")
@Getter
@Setter
private String numero;
@Column(name = "AGENCIA")
@Getter
@Setter
private String agencia;
@Getter
@OneToMany(mappedBy = "conta", targetEntity = Movimentacao.class, fetch = FetchType.LAZY, cascade = CascadeType.ALL)
@Setter
private List<Movimentacao> movimentacoes;
}