/*******************************************************************************
 * This file is part of OpenNMS(R).
 *
 * Copyright (C) 2014 The OpenNMS Group, Inc.
 * OpenNMS(R) is Copyright (C) 1999-2014 The OpenNMS Group, Inc.
 *
 * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc.
 *
 * OpenNMS(R) is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published
 * by the Free Software Foundation, either version 3 of the License,
 * or (at your option) any later version.
 *
 * OpenNMS(R) is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with OpenNMS(R).  If not, see:
 *      http://www.gnu.org/licenses/
 *
 * For more information contact:
 *     OpenNMS(R) Licensing <license@opennms.org>
 *     http://www.opennms.org/
 *     http://www.opennms.com/
 *******************************************************************************/

package org.opennms.netmgt.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(name="requisitioned_categories")
public class RequisitionedCategoryAssociation implements Serializable, Comparable<RequisitionedCategoryAssociation> {
    private static final long serialVersionUID = 1L;

    @Id
    @SequenceGenerator(name="opennmsSequence", sequenceName="opennmsNxtId")
    @GeneratedValue(generator="opennmsSequence")
    @Column(name="id")
    private Integer m_id;

    @Column(name="nodeId", nullable=false)
    private OnmsNode m_node;

    @Column(name="categoryId", nullable=false)
    private OnmsCategory m_category;

    public RequisitionedCategoryAssociation() {
    }

    public RequisitionedCategoryAssociation(final OnmsNode node, final OnmsCategory category) {
        m_node = node;
        m_category = category;
    }

    public Integer getId() {
        return m_id;
    }

    public void setId(final Integer id) {
        m_id = id;
    }

    public OnmsNode getNode() {
        return m_node;
    }

    public void setNode(final OnmsNode node) {
        m_node = node;
    }

    public OnmsCategory getCategory() {
        return m_category;
    }

    public void setCategory(final OnmsCategory category) {
        m_category = category;
    }

    @Override
    public String toString() {
        return "RequisitionedCategoryAssociation [id=" + m_id + ", node=" + m_node.getId() + ", category=" + m_category.getName() + "]";
    }

    @Override
    public int compareTo(final RequisitionedCategoryAssociation o) {
        int ret = m_node.compareTo(o.m_node);
        if (ret == 0) {
            ret = m_category.compareTo(o.m_category);
        }
        return ret;
    }

}

@@ -1375,16 +1375,89 @@
 nce.Id;%0A
+import javax.persistence.JoinColumn;%0Aimport javax.persistence.ManyToOne;%0A
 import j
@@ -1753,306 +1753,58 @@
     
-@Id%0A    @SequenceGenerator(name=%22opennmsSequence%22, sequenceName=%22opennmsNxtId%22)%0A    @GeneratedValue(generator=%22opennmsSequence%22)%0A    @Column(name=%22id%22)%0A    private Integer m_id;%0A%0A    @Column(name=%22nodeId%22, nullable=false)%0A    private OnmsNode m_node;%0A%0A    @Column(name=%22categoryId%22, nullable=false)
+private Integer m_id;%0A    private OnmsNode m_node;
 %0A   
@@ -2042,32 +2042,188 @@
 ategory;%0A    %7D%0A%0A
+    @Id%0A    @SequenceGenerator(name=%22opennmsSequence%22, sequenceName=%22opennmsNxtId%22)%0A    @GeneratedValue(generator=%22opennmsSequence%22)%0A    @Column(name=%22id%22)%0A
     public Integ
@@ -2323,32 +2323,94 @@
 id = id;%0A    %7D%0A%0A
+    @ManyToOne%0A    @JoinColumn(name=%22nodeId%22, nullable=false)%0A
     public OnmsN
@@ -2524,32 +2524,98 @@
  = node;%0A    %7D%0A%0A
+    @ManyToOne%0A    @JoinColumn(name=%22categoryId%22, nullable=false)%0A
     public OnmsC

fix JPA annotations to do what I meant