Added missing UUID columns
parent
801629d139
commit
5f5b310899
|
|
@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonIdentityReference;
|
|||
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
||||
import org.hibernate.envers.Audited;
|
||||
import org.libreccm.core.CcmObjects;
|
||||
import org.libreccm.imexport.Exportable;
|
||||
import org.librecms.assets.ContactableEntity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -33,7 +34,7 @@ import static org.scientificcms.contenttypes.scidepartment.SciDepartmentConstant
|
|||
generator = ObjectIdGenerators.PropertyGenerator.class,
|
||||
property = "uuid"
|
||||
)
|
||||
public class Contact implements Serializable {
|
||||
public class Contact implements Exportable, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
|
@ -42,6 +43,9 @@ public class Contact implements Serializable {
|
|||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private long contactId;
|
||||
|
||||
@Column(name = "uuid", unique = true, nullable = false)
|
||||
private String uuid;
|
||||
|
||||
@Column(name = "CONTACT_TYPE", length = 255, nullable = true)
|
||||
private String contactType;
|
||||
|
||||
|
|
@ -66,6 +70,15 @@ public class Contact implements Serializable {
|
|||
this.contactId = contactId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
protected void setUuid(final String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
public String getContactType() {
|
||||
return contactType;
|
||||
}
|
||||
|
|
@ -102,6 +115,7 @@ public class Contact implements Serializable {
|
|||
public int hashCode() {
|
||||
int hash = 7;
|
||||
hash = 41 * hash + (int) (contactId ^ (contactId >>> 32));
|
||||
hash = 41 * hash * Objects.hashCode(uuid);
|
||||
hash = 41 * hash + Objects.hashCode(contactType);
|
||||
hash = 41 * hash + (int) (order ^ (order >>> 32));
|
||||
hash = 41 * hash + CcmObjects.hashCodeUsingUuid(department);
|
||||
|
|
@ -127,6 +141,9 @@ public class Contact implements Serializable {
|
|||
if (contactId != other.getContactId()) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(uuid, other.getUuid())) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(contactType, other.getContactType())) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -140,7 +157,6 @@ public class Contact implements Serializable {
|
|||
}
|
||||
|
||||
public boolean canEqual(final Object obj) {
|
||||
|
||||
return obj instanceof Contact;
|
||||
}
|
||||
|
||||
|
|
@ -153,6 +169,7 @@ public class Contact implements Serializable {
|
|||
return String.format(
|
||||
"%s{ "
|
||||
+ "contactId = %d, "
|
||||
+ "uuid = %s, "
|
||||
+ "contactType = \"%s\", "
|
||||
+ "order = %d, "
|
||||
+ "project = { %s } "
|
||||
|
|
@ -160,6 +177,7 @@ public class Contact implements Serializable {
|
|||
+ " }",
|
||||
super.toString(),
|
||||
contactId,
|
||||
uuid,
|
||||
contactType,
|
||||
order,
|
||||
Optional
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ package org.scientificcms.contenttypes.scidepartment;
|
|||
|
||||
import org.libreccm.auditing.AbstractAuditedEntityRepository;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
|
||||
/**
|
||||
|
|
@ -39,4 +41,9 @@ public class ContactRepository
|
|||
return contact.getContactId() == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initNewEntity(final Contact contact) {
|
||||
contact.setUuid(UUID.randomUUID().toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package org.scientificcms.contenttypes.scidepartment;
|
|||
import com.fasterxml.jackson.annotation.JsonIdentityReference;
|
||||
import org.hibernate.envers.Audited;
|
||||
import org.libreccm.core.CcmObjects;
|
||||
import org.libreccm.imexport.Exportable;
|
||||
import org.scientificcms.contenttypes.sciproject.SciProject;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -27,7 +28,7 @@ import static org.scientificcms.contenttypes.scidepartment.SciDepartmentConstant
|
|||
@Entity
|
||||
@Audited
|
||||
@Table(name = "DEPARTMENT_PROJECTS", schema = DB_SCHEMA)
|
||||
public class DepartmentProject implements Serializable {
|
||||
public class DepartmentProject implements Exportable, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
|
@ -36,6 +37,9 @@ public class DepartmentProject implements Serializable {
|
|||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private long departmentProjectId;
|
||||
|
||||
@Column(name = "uuid", unique = true, nullable = false)
|
||||
private String uuid;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "DEPARTMENT_ID")
|
||||
@JsonIdentityReference(alwaysAsId = true)
|
||||
|
|
@ -54,6 +58,15 @@ public class DepartmentProject implements Serializable {
|
|||
this.departmentProjectId = departmentProjectId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
protected void setUuid(final String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
public SciDepartment getDepartment() {
|
||||
return department;
|
||||
}
|
||||
|
|
@ -73,9 +86,9 @@ public class DepartmentProject implements Serializable {
|
|||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 7;
|
||||
hash
|
||||
= 59 * hash + (int) (departmentProjectId ^ (departmentProjectId
|
||||
>>> 32));
|
||||
hash = 59 * hash
|
||||
+ (int) (departmentProjectId ^ (departmentProjectId >>> 32));
|
||||
hash = 59 * hash + Objects.hashCode(uuid);
|
||||
hash = 59 * hash + CcmObjects.hashCodeUsingUuid(department);
|
||||
hash = 59 * hash + CcmObjects.hashCodeUsingUuid(project);
|
||||
return hash;
|
||||
|
|
@ -100,6 +113,9 @@ public class DepartmentProject implements Serializable {
|
|||
if (departmentProjectId != other.getDepartmentProjectId()) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(uuid, other.getUuid())) {
|
||||
return false;
|
||||
}
|
||||
if (!CcmObjects.equalsUsingUuid(department, other.getDepartment())) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -119,16 +135,18 @@ public class DepartmentProject implements Serializable {
|
|||
return String.format(
|
||||
"%s{ "
|
||||
+ "departmentProjectId = %d, "
|
||||
+ "uuid = %s, "
|
||||
+ "department = { %s }, "
|
||||
+ "project = { %s}%s"
|
||||
+ " }",
|
||||
super.toString(),
|
||||
departmentProjectId,
|
||||
uuid,
|
||||
Optional
|
||||
.ofNullable(department)
|
||||
.map(
|
||||
dep -> String.format(
|
||||
"objectId = %d,"
|
||||
"objectId = %d, "
|
||||
+ "uuid = \"%s\", "
|
||||
+ "name = \"%s\"",
|
||||
dep.getObjectId(),
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ package org.scientificcms.contenttypes.scidepartment;
|
|||
|
||||
import org.libreccm.auditing.AbstractAuditedEntityRepository;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
|
||||
/**
|
||||
|
|
@ -39,4 +41,9 @@ public class DepartmentProjectRepository
|
|||
return project.getDepartmentProjectId() == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initNewEntity(final DepartmentProject project) {
|
||||
project.setUuid(UUID.randomUUID().toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonIdentityReference;
|
|||
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
||||
import org.hibernate.envers.Audited;
|
||||
import org.libreccm.core.CcmObjects;
|
||||
import org.libreccm.imexport.Exportable;
|
||||
import org.librecms.assets.Person;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -35,7 +36,7 @@ import static org.scientificcms.contenttypes.scidepartment.SciDepartmentConstant
|
|||
generator = ObjectIdGenerators.PropertyGenerator.class,
|
||||
property = "uuid"
|
||||
)
|
||||
public class Membership implements Serializable {
|
||||
public class Membership implements Exportable, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
|
@ -44,6 +45,9 @@ public class Membership implements Serializable {
|
|||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private long membershipId;
|
||||
|
||||
@Column(name = "uuid", unique = true, nullable = false)
|
||||
private String uuid;
|
||||
|
||||
@Column(name = "MEMBER_ROLE", length = 255, nullable = true)
|
||||
private String role;
|
||||
|
||||
|
|
@ -69,6 +73,15 @@ public class Membership implements Serializable {
|
|||
this.membershipId = membershipId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
protected void setUuid(final String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
public String getRole() {
|
||||
return role;
|
||||
}
|
||||
|
|
@ -104,8 +117,8 @@ public class Membership implements Serializable {
|
|||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 7;
|
||||
hash = 37 * hash
|
||||
+ (int) (membershipId ^ (membershipId >>> 32));
|
||||
hash = 37 * hash + (int) (membershipId ^ (membershipId >>> 32));
|
||||
hash = 37 * hash + Objects.hashCode(uuid);
|
||||
hash = 37 * hash + Objects.hashCode(role);
|
||||
hash = 37 * hash + Objects.hashCode(status);
|
||||
hash = 37 * hash + CcmObjects.hashCodeUsingUuid(department);
|
||||
|
|
@ -132,6 +145,9 @@ public class Membership implements Serializable {
|
|||
if (membershipId != other.getMembershipId()) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(uuid, other.getUuid())) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(role, other.getRole())) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -158,6 +174,7 @@ public class Membership implements Serializable {
|
|||
return String.format(
|
||||
"%s{ "
|
||||
+ "membershipId = %d, "
|
||||
+ "uuid = %s, "
|
||||
+ "role = \"%s\", "
|
||||
+ "status = \"%s\","
|
||||
+ "project = { %s }, "
|
||||
|
|
@ -165,6 +182,7 @@ public class Membership implements Serializable {
|
|||
+ " }",
|
||||
super.toString(),
|
||||
membershipId,
|
||||
uuid,
|
||||
role,
|
||||
Objects.toString(status),
|
||||
Optional
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ package org.scientificcms.contenttypes.scidepartment;
|
|||
|
||||
import org.libreccm.auditing.AbstractAuditedEntityRepository;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
|
||||
/**
|
||||
|
|
@ -37,4 +39,9 @@ public class MembershipRepository
|
|||
return membership.getMembershipId() == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initNewEntity(final Membership membership) {
|
||||
membership.setUuid(UUID.randomUUID().toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
alter table SCI_TYPES_DEPARTMENT.DEPARTMENT_CONTACTS
|
||||
add column uuid varchar(255);
|
||||
update SCI_TYPES_DEPARTMENT.DEPARTMENT_CONTACTS set uuid = random_uuid();
|
||||
alter table SCI_TYPES_DEPARTMENT.DEPARTMENT_CONTACTS
|
||||
alter column uuid set not null;
|
||||
alter table SCI_TYPES_DEPARTMENT.DEPARTMENT_CONTACTS
|
||||
add constraint UK_cj8lfjkv543vx69md42sk1voy unique (uuid);
|
||||
alter table SCI_TYPES_DEPARTMENT.DEPARTMENT_CONTACTS_AUD
|
||||
add column uuid varchar(255);
|
||||
|
||||
alter table SCI_TYPES_DEPARTMENT.DEPARTMENT_MEMBERSHIPS
|
||||
add column uuid varchar(255);
|
||||
update SCI_TYPES_DEPARTMENT.DEPARTMENT_MEMBERSHIPS set uuid = random_uuid();
|
||||
alter table SCI_TYPES_DEPARTMENT.DEPARTMENT_MEMBERSHIPS
|
||||
alter column uuid set not null;
|
||||
alter table SCI_TYPES_DEPARTMENT.DEPARTMENT_MEMBERSHIPS
|
||||
add constraint UK_eam1w4v274hfskf9o68q7whho unique (uuid);
|
||||
alter table SCI_TYPES_DEPARTMENT.DEPARTMENT_MEMBERSHIPS_AUD
|
||||
add column uuid varchar(255);
|
||||
|
||||
alter table SCI_TYPES_DEPARTMENT.DEPARTMENT_PROJECTS
|
||||
add column uuid varchar(255);
|
||||
update SCI_TYPES_DEPARTMENT.DEPARTMENT_PROJECTS set uuid = random_uuid();
|
||||
alter table SCI_TYPES_DEPARTMENT.DEPARTMENT_PROJECTS
|
||||
alter column uuid set not null;
|
||||
alter table SCI_TYPES_DEPARTMENT.DEPARTMENT_PROJECTS
|
||||
add constraint UK_nvmvbgwo422wsh4td2jcx6cv7 unique (uuid);
|
||||
alter table SCI_TYPES_DEPARTMENT.DEPARTMENT_PROJECTS_AUD
|
||||
add column uuid varchar(255);
|
||||
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
alter table SCI_TYPES_DEPARTMENT.DEPARTMENT_CONTACTS
|
||||
add column uuid varchar(255);
|
||||
update SCI_TYPES_DEPARTMENT.DEPARTMENT_CONTACTS set uuid = gen_random_uuid();
|
||||
alter table SCI_TYPES_DEPARTMENT.DEPARTMENT_CONTACTS
|
||||
alter column uuid set not null;
|
||||
alter table SCI_TYPES_DEPARTMENT.DEPARTMENT_CONTACTS
|
||||
add constraint UK_cj8lfjkv543vx69md42sk1voy unique (uuid);
|
||||
alter table SCI_TYPES_DEPARTMENT.DEPARTMENT_CONTACTS_AUD
|
||||
add column uuid varchar(255);
|
||||
|
||||
alter table SCI_TYPES_DEPARTMENT.DEPARTMENT_MEMBERSHIPS
|
||||
add column uuid varchar(255);
|
||||
update SCI_TYPES_DEPARTMENT.DEPARTMENT_MEMBERSHIPS set uuid = gen_random_uuid();
|
||||
alter table SCI_TYPES_DEPARTMENT.DEPARTMENT_MEMBERSHIPS
|
||||
alter column uuid set not null;
|
||||
alter table SCI_TYPES_DEPARTMENT.DEPARTMENT_MEMBERSHIPS
|
||||
add constraint UK_eam1w4v274hfskf9o68q7whho unique (uuid);
|
||||
alter table SCI_TYPES_DEPARTMENT.DEPARTMENT_MEMBERSHIPS_AUD
|
||||
add column uuid varchar(255);
|
||||
|
||||
alter table SCI_TYPES_DEPARTMENT.DEPARTMENT_PROJECTS
|
||||
add column uuid varchar(255);
|
||||
update SCI_TYPES_DEPARTMENT.DEPARTMENT_PROJECTS set uuid = gen_random_uuid();
|
||||
alter table SCI_TYPES_DEPARTMENT.DEPARTMENT_PROJECTS
|
||||
alter column uuid set not null;
|
||||
alter table SCI_TYPES_DEPARTMENT.DEPARTMENT_PROJECTS
|
||||
add constraint UK_nvmvbgwo422wsh4td2jcx6cv7 unique (uuid);
|
||||
alter table SCI_TYPES_DEPARTMENT.DEPARTMENT_PROJECTS_AUD
|
||||
add column uuid varchar(255);
|
||||
|
||||
|
|
@ -335,6 +335,13 @@
|
|||
<groupId>org.wildfly.plugins</groupId>
|
||||
<artifactId>wildfly-jar-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<cliSessions>
|
||||
<cli-session>
|
||||
<script-files>
|
||||
<script>./set-transaction-timeout.cli</script>
|
||||
</script-files>
|
||||
</cli-session>
|
||||
</cliSessions>
|
||||
<jvmArguments>
|
||||
<arg>-agentlib:jdwp=transport=dt_socket,server=y,suspend=${libreccm.debug.suspend},address=${libreccm.debug.port}</arg>
|
||||
</jvmArguments>
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
/subsystem=transactions:write-attribute(name=default-timeout,value=3600)
|
||||
Loading…
Reference in New Issue