com.formkiq.server.domain.FolderForm Maven / Gradle / Ivy
/*
* Copyright (C) 2016 FormKiQ Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.formkiq.server.domain;
import java.util.Date;
import java.util.UUID;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import org.hibernate.annotations.Type;
import org.hibernate.annotations.TypeDef;
import org.hibernate.annotations.TypeDefs;
import com.formkiq.server.domain.type.ClientFormType;
import com.formkiq.server.domain.type.StringJsonUserType;
/**
* Form inside of a Folder domain.
*
*/
@Entity
@Table(name = "folder_forms")
@TypeDefs({
@TypeDef(name = "StringJsonObject", typeClass = StringJsonUserType.class)
})
public class FolderForm {
/** identifier column. */
@Id
@Column(name = "folder_form_id", unique = true, columnDefinition = "uuid")
@Type(type = "pg-uuid")
private UUID folderformid;
/** Folder ID column. */
@NotNull
@Column(name = "folder_id", nullable = false, columnDefinition = "uuid")
@Type(type = "pg-uuid")
private UUID folderid;
/** Parent UUID column. */
@Column(name = "parent_uuid", nullable = false)
@Type(type = "pg-uuid")
private UUID parentUUID;
/** UUID column. */
@NotNull
@Column(name = "uuid", nullable = false)
@Type(type = "pg-uuid")
private UUID uuid;
/** type column. */
@NotNull
@Enumerated(EnumType.STRING)
@Column(name = "type", nullable = false)
private ClientFormType type;
/** SHA1 Hash column. */
@NotNull
@Column(name = "sha1_hash", nullable = false)
private String sha1hash;
/** Asset ID column. */
@NotNull
@Column(name = "asset_id", nullable = false, columnDefinition = "uuid")
@Type(type = "pg-uuid")
private UUID assetid;
/** JSON data. */
@Type(type = "StringJsonObject")
@NotNull
@Column(name = "data", nullable = false, columnDefinition = "jsonb")
private String data;
/** inserted column. */
@NotNull
@Column(name = "inserted_date", nullable = false)
private Date insertedDate;
/** updated column. */
@NotNull
@Column(name = "updated_date", nullable = false)
private Date updatedDate;
/**
* default constructor.
*/
public FolderForm() {
}
/**
* @return {@link UUID}
*/
public UUID getUUID() {
return this.uuid;
}
/**
* @param id {@link UUID}
*/
public void setUUID(final UUID id) {
this.uuid = id;
}
/**
* @return {@link Date}
*/
public Date getInsertedDate() {
return this.insertedDate != null ? (Date) this.insertedDate.clone()
: null;
}
/**
* @param date {@link Date}
*/
public void setInsertedDate(final Date date) {
this.insertedDate = date != null ? (Date) date.clone() : null;
}
/**
* @return {@link Date}
*/
public Date getUpdatedDate() {
return this.updatedDate != null ? (Date) this.updatedDate.clone()
: null;
}
/**
* @param date {@link Date}
*/
public void setUpdatedDate(final Date date) {
this.updatedDate = date != null ? (Date) date.clone() : null;
}
/**
* @return byte[]
*/
public String getSha1hash() {
return this.sha1hash;
}
/**
* @param hash byte[]
*/
public void setSha1hash(final String hash) {
this.sha1hash = hash;
}
/**
* @return {@link UUID}
*/
public UUID getAssetid() {
return this.assetid;
}
/**
* @param asset {@link UUID}
*/
public void setAssetid(final UUID asset) {
this.assetid = asset;
}
/**
* @return {@link String}
*/
public String getData() {
return this.data;
}
/**
* @param string {@link String}
*/
public void setData(final String string) {
this.data = string;
}
/**
* @return {@link UUID}
*/
public UUID getParentUUID() {
return this.parentUUID;
}
/**
* @param parent {@link UUID}
*/
public void setParentUUID(final UUID parent) {
this.parentUUID = parent;
}
/**
* @return {@link ClientFormType}
*/
public ClientFormType getType() {
return this.type;
}
/**
* @param formtype {@link ClientFormType}
*/
public void setType(final ClientFormType formtype) {
this.type = formtype;
}
/**
* @return {@link UUID}
*/
public UUID getFolderformid() {
return this.folderformid;
}
/**
* @param folderform {@link UUID}
*/
public void setFolderformid(final UUID folderform) {
this.folderformid = folderform;
}
/**
* @return {@link UUID}
*/
public UUID getFolderid() {
return this.folderid;
}
/**
* @param folder {@link UUID}
*/
public void setFolderid(final UUID folder) {
this.folderid = folder;
}
}