CompoEntryParticipant.java 2.81 KB
/*
 * Copyright Codecrew Ry
 * 
 * All rights reserved.
 * 
 * This license applies to any software containing a notice placed by the 
 * copyright holder. Such software is herein referred to as the Software. 
 * This license covers modification, distribution and use of the Software. 
 * 
 * Any distribution and use in source and binary forms, with or without 
 * modification is not permitted without explicit written permission from the 
 * copyright owner. 
 * 
 * A non-exclusive royalty-free right is granted to the copyright owner of the 
 * Software to use, modify and distribute all modifications to the Software in 
 * future versions of the Software. 
 * 
 */
package fi.codecrew.moya.model;

import java.util.Calendar;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * 
 */
@Entity
@Table(name = "compo_entry_participations")
public class CompoEntryParticipant extends GenericEntity {
    private static final long serialVersionUID = 2L;

    @JoinColumn(name = "entry_id", referencedColumnName = "id", nullable = false, updatable = false)
    @ManyToOne(optional = false)
    private CompoEntry entry;

    @Column(name = "role")
    private String role;

    @Column(name = "nick")
    private String nick;

    @Column(name = "confirmed")
    @Temporal(TemporalType.TIMESTAMP)
    private Calendar confirmed;

    @JoinColumn(name = "eventuser_id", referencedColumnName = EventUser.ID_COLUMN, nullable = false, updatable = false)
    @ManyToOne(optional = false)
    private EventUser user;

    public CompoEntry getEntry() {
        return entry;
    }

    public void setEntry(CompoEntry entry) {
        this.entry = entry;
    }

    public CompoEntryParticipant(CompoEntry entry, EventUser participant) {
        super();
        this.entry = entry;
        this.user = participant;
    }

    public CompoEntryParticipant() {
        super();
    }

    public String getRole() {
        return role;
    }

    public void setRole(String role) {
        this.role = role;
    }

    public EventUser getUser() {
        return user;
    }

    public void setUser(EventUser user) {
        this.user = user;
    }

    /**
     * @return the nick
     */
    public String getNick() {
        return nick;
    }

    /**
     * @param nick
     *            the nick to set
     */
    public void setNick(String nick) {
        this.nick = nick;
    }

    /**
     * @return the confirmed
     */
    public Calendar getConfirmed() {
        return confirmed;
    }

    /**
     * @param confirmed
     *            the confirmed to set
     */
    public void setConfirmed(Calendar confirmed) {
        this.confirmed = confirmed;
    }

}