alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Hibernate example source code file (ListJoinColumnBidirectionalInheritanceRefEdChildEntity.java)

This example Hibernate source code file (ListJoinColumnBidirectionalInheritanceRefEdChildEntity.java) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Hibernate tags/keywords

audited, discriminatorvalue, entity, listjoincolumnbidirectionalinheritancerefedchildentity, listjoincolumnbidirectionalinheritancerefedchildentity, listjoincolumnbidirectionalinheritancerefedparententity, listjoincolumnbidirectionalinheritancerefingentity, listjoincolumnbidirectionalinheritancerefingentity, override, override, string, string

The Hibernate ListJoinColumnBidirectionalInheritanceRefEdChildEntity.java source code

package org.hibernate.envers.test.entities.onetomany.detached;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import org.hibernate.envers.Audited;

/**
 * Entity for {@link org.hibernate.envers.test.integration.onetomany.detached.JoinColumnBidirectionalListWithInheritance} test.
 * Owned child side of the relation.
 * @author Adam Warski (adam at warski dot org)
 */
@Entity
@DiscriminatorValue("2")
@Audited
public class ListJoinColumnBidirectionalInheritanceRefEdChildEntity extends ListJoinColumnBidirectionalInheritanceRefEdParentEntity {
    private String childData;

    public ListJoinColumnBidirectionalInheritanceRefEdChildEntity() { }

    public ListJoinColumnBidirectionalInheritanceRefEdChildEntity(Integer id, String parentData, ListJoinColumnBidirectionalInheritanceRefIngEntity owner, String childData) {
        super(id, parentData, owner);
        this.childData = childData;
    }

    public ListJoinColumnBidirectionalInheritanceRefEdChildEntity(String parentData, ListJoinColumnBidirectionalInheritanceRefIngEntity owner, String childData) {
        super(parentData, owner);
        this.childData = childData;
    }

    public String getChildData() {
        return childData;
    }

    public void setChildData(String childData) {
        this.childData = childData;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;

        ListJoinColumnBidirectionalInheritanceRefEdChildEntity that = (ListJoinColumnBidirectionalInheritanceRefEdChildEntity) o;

        //noinspection RedundantIfStatement
        if (childData != null ? !childData.equals(that.childData) : that.childData != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = super.hashCode();
        result = 31 * result + (childData != null ? childData.hashCode() : 0);
        return result;
    }

    public String toString() {
        return "ListJoinColumnBidirectionalInheritanceRefEdChildEntity(id = " + getId() + 
                ", parentData = " + getParentData() + ", childData = " + childData + ")";
    }
}

Other Hibernate examples (source code examples)

Here is a short list of links related to this Hibernate ListJoinColumnBidirectionalInheritanceRefEdChildEntity.java source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.