blob: c794b1403cf5a6434a5ee6a56b5b4bffb84df1fd [file] [log] [blame]
Matthias Andreas Benkardd9b95882020-01-24 11:42:49 +01001package eu.mulk.mulkcms2.benki.accesscontrol;
Matthias Andreas Benkard734879e2020-01-24 10:47:37 +01002
Matthias Andreas Benkardd9b95882020-01-24 11:42:49 +01003import eu.mulk.mulkcms2.benki.users.User;
Matthias Andreas Benkard35cb1592020-01-24 11:05:20 +01004import io.quarkus.hibernate.orm.panache.PanacheEntityBase;
Matthias Andreas Benkarde3bc3ee2023-08-06 16:21:11 +02005import jakarta.persistence.Column;
6import jakarta.persistence.Entity;
7import jakarta.persistence.FetchType;
8import jakarta.persistence.Id;
9import jakarta.persistence.IdClass;
10import jakarta.persistence.JoinColumn;
11import jakarta.persistence.ManyToOne;
12import jakarta.persistence.Table;
Matthias Andreas Benkard734879e2020-01-24 10:47:37 +010013import java.math.BigInteger;
Matthias Andreas Benkard734879e2020-01-24 10:47:37 +010014
15@Entity
Matthias Andreas Benkard57c9a8a2020-01-24 19:09:38 +010016@Table(name = "page_keys", schema = "benki")
Matthias Andreas Benkard734879e2020-01-24 10:47:37 +010017@IdClass(PageKeyPK.class)
Matthias Andreas Benkard35cb1592020-01-24 11:05:20 +010018public class PageKey extends PanacheEntityBase {
Matthias Andreas Benkard734879e2020-01-24 10:47:37 +010019
20 @Id
21 @Column(name = "page", nullable = false, length = -1)
Matthias Andreas Benkard35cb1592020-01-24 11:05:20 +010022 public String page;
Matthias Andreas Benkard734879e2020-01-24 10:47:37 +010023
24 @Id
25 @Column(name = "key", nullable = false, precision = 0)
Matthias Andreas Benkard35cb1592020-01-24 11:05:20 +010026 public BigInteger key;
Matthias Andreas Benkard734879e2020-01-24 10:47:37 +010027
Matthias Andreas Benkardaa754802020-01-24 11:55:26 +010028 @ManyToOne(fetch = FetchType.LAZY)
Matthias Andreas Benkardcf0fe882020-04-19 18:33:37 +020029 @JoinColumn(name = "\"user\"", referencedColumnName = "id", nullable = false)
Matthias Andreas Benkard35cb1592020-01-24 11:05:20 +010030 public User user;
Matthias Andreas Benkard734879e2020-01-24 10:47:37 +010031}