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

com.blazebit.persistence.testsuite.entity.Root Maven / Gradle / Ivy

There is a newer version: 1.6.12
Show newest version
/*
 * Copyright 2014 - 2019 Blazebit.
 *
 * 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 com.blazebit.persistence.testsuite.entity;

import javax.persistence.CollectionTable;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.MapKeyColumn;
import javax.persistence.OneToMany;
import javax.persistence.OrderColumn;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 *
 * @author Moritz Becker
 * @since 1.2.0
 */
@Entity(name = "Root")
public class Root {

    @Id
    private Integer id;
    private String name;

    @OneToMany
    @JoinTable(name = "list_one_to_many")
    @OrderColumn(name = "join_table_list_index")
    private List indexedNodes = new ArrayList<>();
    @OneToMany
    @JoinTable(name = "map_one_to_many")
    @MapKeyColumn(name = "join_table_map_key1", length = 10)
    private Map keyedNodes = new HashMap<>();

    @ManyToMany
    @JoinTable(name = "list_many_to_many")
    @OrderColumn(name = "join_table_list_index")
    private List indexedNodesMany = new ArrayList<>();
    @ManyToMany
    @JoinTable(name = "map_many_to_many")
    @MapKeyColumn(name = "join_table_map_key2", length = 10)
    private Map keyedNodesMany = new HashMap<>();

    @ManyToMany
    @JoinTable(name = "list_many_to_many_duplicate")
    @OrderColumn(name = "list_index")
    private List indexedNodesManyDuplicate = new ArrayList<>();
    @ManyToMany
    @JoinTable(name = "map_many_to_many_duplicate")
    @MapKeyColumn(name = "map_key", length = 10)
    private Map keyedNodesManyDuplicate = new HashMap<>();

    @ElementCollection
    @CollectionTable(name = "list_collection_table")
    @OrderColumn(name = "list_index")
    private List indexedNodesElementCollection = new ArrayList<>();
    @ElementCollection
    @CollectionTable(name = "map_collection_table")
    @MapKeyColumn(name = "map_key", length = 10)
    private Map keyedNodesElementCollection = new HashMap<>();

    public Root() {
    }

    public Root(Integer id) {
        this.id = id;
    }

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

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

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

    public List getIndexedNodes() {
        return indexedNodes;
    }

    public void setIndexedNodes(List indexedNodes) {
        this.indexedNodes = indexedNodes;
    }

    public Map getKeyedNodes() {
        return keyedNodes;
    }

    public void setKeyedNodes(Map keyedNodes) {
        this.keyedNodes = keyedNodes;
    }

    public List getIndexedNodesMany() {
        return indexedNodesMany;
    }

    public void setIndexedNodesMany(List indexedNodesMany) {
        this.indexedNodesMany = indexedNodesMany;
    }

    public Map getKeyedNodesMany() {
        return keyedNodesMany;
    }

    public void setKeyedNodesMany(Map keyedNodesMany) {
        this.keyedNodesMany = keyedNodesMany;
    }

    public List getIndexedNodesManyDuplicate() {
        return indexedNodesManyDuplicate;
    }

    public void setIndexedNodesManyDuplicate(List indexedNodesManyDuplicate) {
        this.indexedNodesManyDuplicate = indexedNodesManyDuplicate;
    }

    public Map getKeyedNodesManyDuplicate() {
        return keyedNodesManyDuplicate;
    }

    public void setKeyedNodesManyDuplicate(Map keyedNodesManyDuplicate) {
        this.keyedNodesManyDuplicate = keyedNodesManyDuplicate;
    }

    public List getIndexedNodesElementCollection() {
        return indexedNodesElementCollection;
    }

    public void setIndexedNodesElementCollection(List indexedNodesElementCollection) {
        this.indexedNodesElementCollection = indexedNodesElementCollection;
    }

    public Map getKeyedNodesElementCollection() {
        return keyedNodesElementCollection;
    }

    public void setKeyedNodesElementCollection(Map keyedNodesElementCollection) {
        this.keyedNodesElementCollection = keyedNodesElementCollection;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy