Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 4dc3d78e authored by Joze RIHTARSIC's avatar Joze RIHTARSIC
Browse files

Add database column description

parent d2ab3bd5
No related branches found
No related tags found
No related merge requests found
......@@ -13,6 +13,7 @@
package eu.europa.ec.edelivery.smp.data.model;
import eu.europa.ec.edelivery.smp.data.dao.utils.ColumnDescription;
import org.hibernate.envers.Audited;
import javax.persistence.*;
......@@ -28,22 +29,28 @@ import java.util.Objects;
@NamedQueries({
@NamedQuery(name = "DBConfiguration.getAll", query = "SELECT d FROM DBConfiguration d"),
})
@org.hibernate.annotations.Table(appliesTo = "SMP_CONFIGURATION", comment = "SMP user certificates")
public class DBConfiguration implements Serializable {
private static final long serialVersionUID = 1905122041950251201L;
@Id
@Column(name = "PROPERTY", length = CommonColumnsLengths.MAX_TEXT_LENGTH_512, nullable = false, unique = true)
@ColumnDescription(comment = "Property name/key")
String property;
@Column(name = "VALUE", length = CommonColumnsLengths.MAX_FREE_TEXT_LENGTH)
@ColumnDescription(comment = "Property value")
String value;
@Column(name = "DESCRIPTION", length = CommonColumnsLengths.MAX_FREE_TEXT_LENGTH)
@ColumnDescription(comment = "Property description")
String description;
@Column(name = "CREATED_ON", nullable = false)
@ColumnDescription(comment = "Row inserted on date")
LocalDateTime createdOn;
@Column(name = "LAST_UPDATED_ON", nullable = false)
@ColumnDescription(comment = "Row modified on date")
LocalDateTime lastUpdatedOn;
......
......@@ -13,6 +13,7 @@
package eu.europa.ec.edelivery.smp.data.model;
import eu.europa.ec.edelivery.smp.data.dao.utils.ColumnDescription;
import org.hibernate.envers.Audited;
import javax.persistence.*;
......@@ -44,27 +45,36 @@ import java.time.LocalDateTime;
@ColumnResult(name = "smlSubdomain", type = String.class),
@ColumnResult(name = "useCount", type = Integer.class)})
})
@org.hibernate.annotations.Table(appliesTo = "SMP_DOMAIN", comment = "SMP can handle multiple domains. This table contains domain specific data")
public class DBDomain extends BaseEntity {
@Id
@SequenceGenerator(name = "domain_generator", sequenceName = "SMP_DOMAIN_SEQ", allocationSize = 1)
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "domain_generator")
@Column(name = "ID")
@ColumnDescription(comment = "Unique domain id")
Long id;
@Column(name = "DOMAIN_CODE", length = CommonColumnsLengths.MAX_DOMAIN_CODE_LENGTH, nullable = false, unique = true)
@ColumnDescription(comment = "Domain code used as http parameter in rest webservices")
String domainCode;
@Column(name = "SML_SUBDOMAIN", length = CommonColumnsLengths.MAX_SML_SUBDOMAIN_LENGTH, unique = true)
@ColumnDescription(comment = "SML subdomain")
String smlSubdomain;
@Column(name = "SML_SMP_ID", length = CommonColumnsLengths.MAX_SML_SMP_ID_LENGTH)
@ColumnDescription(comment = "SMP ID used for SML integration")
String smlSmpId;
@Column(name = "SML_PARTC_IDENT_REGEXP", length = CommonColumnsLengths.MAX_FREE_TEXT_LENGTH)
@ColumnDescription(comment = "Reqular expresion for participant ids")
String smlParticipantIdentifierRegExp;
@Column(name = "SML_CLIENT_CERT_HEADER", length = CommonColumnsLengths.MAX_FREE_TEXT_LENGTH)
@ColumnDescription(comment = "Client-Cert header used behind RP - BlueCoat for SML integration")
String smlClientCertHeader;
@Column(name = "SML_CLIENT_KEY_ALIAS", length = CommonColumnsLengths.MAX_CERT_ALIAS_LENGTH)
@ColumnDescription(comment = "Client key alias used for SML integration")
String smlClientKeyAlias;
@Column(name = "SIGNATURE_KEY_ALIAS", length = CommonColumnsLengths.MAX_CERT_ALIAS_LENGTH)
@ColumnDescription(comment = "Signature key alias used for SML integration")
String signatureKeyAlias;
@Column(name = "CREATED_ON", nullable = false)
......@@ -73,9 +83,11 @@ public class DBDomain extends BaseEntity {
LocalDateTime lastUpdatedOn;
@Column(name = "SML_REGISTERED", nullable = false)
@ColumnDescription(comment = "Flag for: Is domain registered in SML")
private boolean smlRegistered = false;
@Column(name = "SML_BLUE_COAT_AUTH", nullable = false)
@ColumnDescription(comment = "Flag for SML authentication type - use CLientCert header or HTTPS ClientCertificate (key)")
private boolean smlBlueCoatAuth = false;
public DBDomain() {
......
......@@ -12,6 +12,7 @@
*/
package eu.europa.ec.edelivery.smp.data.model;
import eu.europa.ec.edelivery.smp.data.dao.utils.ColumnDescription;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.envers.Audited;
......@@ -22,6 +23,7 @@ import java.util.Objects;
@Entity
@Audited
@Table(name = "SMP_USER")
@org.hibernate.annotations.Table(appliesTo = "SMP_USER", comment = "SMP can handle multiple domains. This table contains domain specific data")
@NamedQueries({
// case insesitive search
@NamedQuery(name = "DBUser.getUserByUsernameInsensitive", query = "SELECT u FROM DBUser u WHERE lower(u.username) = lower(:username)"),
......@@ -51,22 +53,29 @@ public class DBUser extends BaseEntity {
@SequenceGenerator(name = "usr_generator", sequenceName = "SMP_USER_SEQ",allocationSize = 1 )
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "usr_generator" )
@Column(name = "ID")
@ColumnDescription(comment = "Unique user id")
Long id;
@Column(name = "USERNAME", length = CommonColumnsLengths.MAX_USERNAME_LENGTH, unique = true)
@ColumnDescription(comment = "Login username")
private String username;
@Column(name = "PASSWORD", length = CommonColumnsLengths.MAX_PASSWORD_LENGTH)
@ColumnDescription(comment = "BCrypted password for username/password login")
private String password;
@Column(name = "EMAIL", length = CommonColumnsLengths.MAX_PASSWORD_LENGTH)
@ColumnDescription(comment = "User email")
private String emailAddress;
@Column(name = "PASSWORD_CHANGED")
@ColumnDescription(comment = "Last date when password was changed")
LocalDateTime passwordChanged;
@Column(name = "ACTIVE", nullable = false)
@ColumnDescription(comment = "Is user active")
private boolean active = true;
// user can have only one of the role smp_admin, servicegroup_admin, system_admin
@Column(name = "ROLE", length = CommonColumnsLengths.MAX_USER_ROLE_LENGTH)
@ColumnDescription(comment = "User role")
private String role;
@OneToOne(mappedBy = "dbUser", cascade = CascadeType.ALL, fetch = FetchType.EAGER, optional = true,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment