package com.battleejb.entities;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;


/**
 * The persistent class for the Text database table.
 * @author marina
 * 
 */
@Entity

@NamedQueries({
	 @NamedQuery(name = "News.findAll", query = "SELECT n FROM News n ORDER BY n.loadDate DESC"),
	 @NamedQuery(name = "News.findLast", query = "SELECT n FROM News n ORDER BY n.loadDate DESC"),
	 @NamedQuery(name = "News.findOlder", query = "SELECT n FROM News n ORDER BY n.loadDate ASC")
})
public class News implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer id;

	private Integer keyval;
	
	@Temporal(TemporalType.DATE)
	private Date loadDate;

	private String photoPath;
	
	@OneToOne(fetch=FetchType.LAZY, cascade = CascadeType.PERSIST)
	private Text text;
	
//----------------------------------
	
	public News() {
	}
//----------------------------------	

	public Integer getId() {
		return id;
	}

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

	public Integer getKeyval() {
		return keyval;
	}

	public void setKeyval(Integer keyval) {
		this.keyval = keyval;
	}

	public Date getLoadDate() {
		return loadDate;
	}

	public void setLoadDate(Date loadDate) {
		this.loadDate = loadDate;
	}

	public String getPhotoPath() {
		return photoPath;
	}

	public void setPhotoPath(String photoPath) {
		this.photoPath = photoPath;
	}

	public Text getText() {
		return text;
	}

	public void setText(Text text) {
		this.text = text;
	}

	
	
	
	
}

@@ -108,88 +108,14 @@
 nce.
-CascadeType;%0Aimport javax.persistence.Entity;%0Aimport javax.persistence.FetchType
+Entity
 ;%0Aim
@@ -303,43 +303,8 @@
 ry;%0A
-import javax.persistence.OneToOne;%0A
 impo
@@ -949,34 +949,8 @@
  id;
-%0A%0A%09private Integer keyval;
 %0A%09%0A%09
@@ -1037,92 +1037,110 @@
 %0A%09%0A%09
-@OneToOne(fetch=FetchType.LAZY, cascade = CascadeType.PERSIST)%0A%09private Text text;%0A%09
+private String titleEn;%0A%0A%09private String titleNl;%0A%09%0A%09private String valueEn;%0A%0A%09private String valueNl;
 %0A//-
@@ -1334,128 +1334,8 @@
 %09%7D%0A%0A
-%09public Integer getKeyval() %7B%0A%09%09return keyval;%0A%09%7D%0A%0A%09public void setKeyval(Integer keyval) %7B%0A%09%09this.keyval = keyval;%0A%09%7D%0A%0A
 %09pub
@@ -1604,20 +1604,25 @@
 lic 
-Text getText
+String getTitleEn
 () %7B
@@ -1632,19 +1632,22 @@
 return t
-ext
+itleEn
 ;%0A%09%7D%0A%0A%09p
@@ -1665,55 +1665,433 @@
 setT
-ext(Text text) %7B%0A%09%09this.text = text;%0A%09%7D%0A%0A%09%0A%09%0A%09%0A
+itleEn(String titleEn) %7B%0A%09%09this.titleEn = titleEn;%0A%09%7D%0A%0A%09public String getTitleNl() %7B%0A%09%09return titleNl;%0A%09%7D%0A%0A%09public void setTitleNl(String titleNl) %7B%0A%09%09this.titleNl = titleNl;%0A%09%7D%0A%0A%09public String getValueEn() %7B%0A%09%09return valueEn;%0A%09%7D%0A%0A%09public void setValueEn(String valueEn) %7B%0A%09%09this.valueEn = valueEn;%0A%09%7D%0A%0A%09public String getValueNl() %7B%0A%09%09return valueNl;%0A%09%7D%0A%0A%09public void setValueNl(String valueNl) %7B%0A%09%09this.valueNl = valueNl;%0A%09%7D
 %09%0A%7D%0A

Update News.java