/*
	cursus - Race series management program
	Copyright 2011  Simon Arlott

	This program 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.

	This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package eu.lp0.cursus.db.data;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

@Entity(name = "race_no")
@Table(uniqueConstraints = { @UniqueConstraint(columnNames = { "organisation", "number" }) })
public class RaceNumber extends AbstractEntity {
	private String organisation;
	private int number;

	public RaceNumber(String organisation, int number) {
		setOrganisation(organisation);
		setNumber(number);
	}

	public String getOrganisation() {
		return organisation;
	}

	public void setOrganisation(String organisation) {
		this.organisation = organisation;
	}

	public int getNumber() {
		return number;
	}

	public void setNumber(int number) {
		this.number = number;
	}

	@Override
	public String toString() {
		return String.format("%s%02d", getOrganisation(), getNumber()); //$NON-NLS-1$
	}
}
@@ -726,16 +726,49 @@
 .data;%0A%0A
+import javax.persistence.Column;%0A
 import j
@@ -1197,24 +1197,51 @@
 umber);%0A%09%7D%0A%0A
+%09@Column(nullable = false)%0A
 %09public Stri
@@ -1382,24 +1382,51 @@
 on;%0A%09%7D%0A%0A
+%09@Column(nullable = false)%0A
 %09public 
 int getN
@@ -1417,19 +1417,23 @@
 %09public 
-i
+I
 nt
+eger
  getNumb

mark race number columns as not null