org.wallride.domain.NavigationItem Maven / Gradle / Ivy
/*
* Copyright 2014 Tagbangers, 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 org.wallride.domain;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.*;
import java.util.Set;
@Entity
@Table(name="navigation_item")
@Inheritance(strategy= InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name="type", discriminatorType=DiscriminatorType.STRING)
@DynamicInsert
@DynamicUpdate
@SuppressWarnings("serial")
public abstract class NavigationItem extends DomainObject {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
private long id;
@Column(nullable=false)
private int sort;
@Column(nullable=false)
private String language;
@ManyToOne
private NavigationItem parent;
@OneToMany(mappedBy="parent")
private Set children;
@Override
public Long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public int getSort() {
return sort;
}
public void setSort(int sort) {
this.sort = sort;
}
public String getLanguage() {
return language;
}
public void setLanguage(String language) {
this.language = language;
}
public NavigationItem getParent() {
return parent;
}
public void setParent(NavigationItem parent) {
this.parent = parent;
}
public Set getChildren() {
return children;
}
public void setChildren(Set children) {
this.children = children;
}
}