Skip to content

Commit

Permalink
Edited
Browse files Browse the repository at this point in the history
  • Loading branch information
ohbus committed Jul 3, 2021
1 parent d9ab76a commit caa665a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Expand Up @@ -35,22 +35,27 @@
import javax.persistence.Table;
import lombok.Data;
import lombok.RequiredArgsConstructor;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.NaturalId;
import org.hibernate.annotations.NaturalIdCache;
import org.hibernate.annotations.UpdateTimestamp;

@Entity(name = "Roles")
@Table(
name = "roles",
indexes = {@Index(columnList = "roles_name")})
@Data
@NaturalIdCache
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@RequiredArgsConstructor
public class Roles implements Serializable {

private static final long serialVersionUID = 38920613133424876L;

@Id
@Column(name = "roles_id")
@GeneratedValue(strategy = GenerationType.AUTO)
private Integer rolesId;

Expand Down
Expand Up @@ -62,12 +62,12 @@ public class UsersAuthenticationDetails implements UserDetails, Serializable {
private static final long serialVersionUID = 3577019301886090937L;

@Id
@Column(name = "users_id", columnDefinition = "BINARY(16)")
@Column(columnDefinition = "BINARY(16)")
private UUID id;

@MapsId
@OneToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "users_id", columnDefinition = "BINARY(16)")
@JoinColumn(columnDefinition = "BINARY(16)")
private Users users;

@OneToOne(fetch = FetchType.EAGER, targetEntity = Users.class)
Expand Down

0 comments on commit caa665a

Please sign in to comment.