Great tutorial, Ariel, but I am searching for a new scenario. What about in this classes below in Java, please?
public class User implements Serializable, UserDetails {
@Id @GeneratedValue(generator = "uuid") @GenericGenerator(name = "uuid", strategy = "uuid2") @Size(max = 36) @Column(name = "userId") private String userId; @JoinColumn(name = "accountId", referencedColumnName = "accountId", nullable = false) @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL) @JsonInclude(JsonInclude.Include.NON_NULL) private Account account; @Column(name = "userName") private String userName; @Column(name = "emailAddress") private String emailAddress; @Column(name = "password") private String password;
... }
public class Account implements Serializable {
@Id @GeneratedValue(generator = "uuid") @GenericGenerator(name = "uuid", strategy = "uuid2") @Size(max = 36) @Column(name = "accountId") private String accountId; @Column(name = "accountName") private String accountName; @Column(name = "company") private String company; @Column(name = "address") private String address; @Column(name = "emailAddress") private String emailAddress; @Column(name = "dicomId") private String dicomId; @Column(name = "enabled") @ColumnDefault(value = "1") private Integer enabled; @OneToMany (mappedBy = "account", cascade = CascadeType.ALL, orphanRemoval = true) Set<User> users = new HashSet<>();
Thanks in advance! :)
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Great tutorial, Ariel, but I am searching for a new scenario. What about in this classes below in Java, please?
public class User implements Serializable, UserDetails {
...
}
public class Account implements Serializable {
...
}
Thanks in advance! :)