View Javadoc
1   /******************************************************************************
2    * Video_Writer.java - domain object
3    * $Id: Video_Writer.java,v 1.2 2015/04/12 21:18:44 dick Exp $
4    * 
5    * BuckoVidLib - The BuckoSoft Video Library
6    * Copyright(c) 2015 - Dick Balaska
7    * 
8    * $Log: Video_Writer.java,v $
9    * Revision 1.2  2015/04/12 21:18:44  dick
10   * Need to override hashcode and equals for hibernate composites.
11   *
12   * Revision 1.1  2015/04/02 23:41:42  dick
13   * Map Writers to Videos.
14   *
15   */
16  package com.buckosoft.BuckoVidLib.domain;
17  
18  import java.io.Serializable;
19  
20  import com.buckosoft.BuckoVidLib.util.HashCodeUtil;
21  
22  /** Map Writers to Videos.
23   * @author dick
24   * @since 2015-04-01
25   */
26  public class Video_Writer implements Serializable {
27  	private static final long serialVersionUID = 1L;
28  	int	videoId;
29  	int	writerId;
30  
31  	/* (non-Javadoc)
32  	 * @see java.lang.Object#equals(java.lang.Object)
33  	 */
34  	@Override
35  	public boolean equals(Object obj) {
36  		return(videoId == ((Video_Writer)obj).videoId && writerId == ((Video_Writer)obj).writerId);
37  	}
38  
39  	/* (non-Javadoc)
40  	 * @see java.lang.Object#hashCode()
41  	 */
42  	@Override
43  	public int hashCode() {
44  		int result = HashCodeUtil.SEED;
45  		result = HashCodeUtil.hash(result, videoId);
46  		result = HashCodeUtil.hash(result, writerId);
47  		return(result);
48  	}
49  	/**
50  	 * @return the videoId
51  	 */
52  	public int getVideoId() {
53  		return videoId;
54  	}
55  	/**
56  	 * @param videoId the videoId to set
57  	 */
58  	public void setVideoId(int videoId) {
59  		this.videoId = videoId;
60  	}
61  	/**
62  	 * @return the writerId
63  	 */
64  	public int getWriterId() {
65  		return writerId;
66  	}
67  	/**
68  	 * @param writerId the writerId to set
69  	 */
70  	public void setWriterId(int writerId) {
71  		this.writerId = writerId;
72  	}
73  	
74  }