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

com.github.gentity.test.test4a_polymorphism_joined.Insect Maven / Gradle / Ivy

There is a newer version: 1.0.0
Show newest version

package com.github.gentity.test.test4a_polymorphism_joined;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.ForeignKey;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;

@Entity
@Table(name = "INSECT")
@DiscriminatorValue("IN")
@PrimaryKeyJoinColumn(name = "LIFEFORM_ID", referencedColumnName = "ID", foreignKey = @ForeignKey(name = "FK_INSECT_LIFEFORM"))
public class Insect
    extends Lifeform
    implements Serializable
{

    @Column(name = "STINGY", nullable = false)
    protected boolean stingy;

    public static Insect.Builder builder() {
        return new Insect.Builder();
    }

    public boolean getStingy() {
        return stingy;
    }

    public void setStingy(boolean stingy) {
        this.stingy = stingy;
    }

    public static class Builder
        extends Lifeform.Builder
    {

        private final Insect instance = new Insect();

        public Insect build() {
            return instance;
        }

        public Insect.Builder stingy(boolean stingy) {
            instance.stingy = stingy;
            return this;
        }

        public Insect.Builder id(Long id) {
            instance.id = id;
            return this;
        }

        public Insect.Builder name(String name) {
            instance.name = name;
            return this;
        }

        public Insect.Builder weight(double weight) {
            instance.weight = weight;
            return this;
        }

    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy