All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.catools.etl.model.CEtlProject Maven / Gradle / Ivy

There is a newer version: 0.1.25
Show newest version
package org.catools.etl.model;

import org.catools.common.json.CJsonUtil;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Objects;

@NamedQueries(
        {
                @NamedQuery(
                        name = "getProjectById",
                        query = "FROM CEtlProject where id=:id"
                ),
                @NamedQuery(
                        name = "getProjects",
                        query = "FROM CEtlProject"
                )
        }
)
@Entity
@Table(name = "project", schema = "etl")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE, region = "project")
public class CEtlProject implements Serializable {

    private static final long serialVersionUID = 6069874018185613707L;

    @Id
    @Column(name = "id", length = 20, unique = true, nullable = false)
    private String id;

    @Column(name = "name", length = 250, unique = true, nullable = false)
    private String name;

    public CEtlProject() {
    }

    public CEtlProject(String id, String name) {
        this.id = id;
        this.name = name;
    }

    public String getId() {
        return id;
    }

    public CEtlProject setId(String id) {
        this.id = id;
        return this;
    }

    public String getName() {
        return name;
    }

    public CEtlProject setName(String name) {
        this.name = name;
        return this;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        CEtlProject that = (CEtlProject) o;
        return Objects.equals(id, that.id) && Objects.equals(name, that.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, id, name);
    }

    @Override
    public String toString() {
        return CJsonUtil.toString(this);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy