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

com.github.gentity.test.test4a_polymorphism_joined.Mammal 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 = "MAMMAL")
@DiscriminatorValue("MA")
@PrimaryKeyJoinColumn(name = "LIFEFORM_ID", referencedColumnName = "ID", foreignKey = @ForeignKey(name = "FK_MAMMAL_LIFEFORM"))
public class Mammal
    extends Lifeform
    implements Serializable
{

    @Column(name = "FURRY", nullable = false)
    protected boolean furry;

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

    public boolean getFurry() {
        return furry;
    }

    public void setFurry(boolean furry) {
        this.furry = furry;
    }

    public static class Builder
        extends Lifeform.Builder
    {

        private final Mammal instance = new Mammal();

        public Mammal build() {
            return instance;
        }

        public Mammal.Builder furry(boolean furry) {
            instance.furry = furry;
            return this;
        }

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

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

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

    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy