package domain;

import javax.persistence.Entity;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;

@Entity
@Table(name = Game.TABLE)
public class MinesWeeper {
	public static final String TABLE = "MINESWEEPER";

	public MinesWeeper() {}
	
	private static MinesWeeper instance;
	public static MinesWeeper getInstance() {
		if (instance == null)
			instance = new MinesWeeper();
		return instance;
	}
	
	@OneToOne
    @PrimaryKeyJoinColumn(name = "id_game_fk", referencedColumnName = "id_game")    
	private Game game;
	public void setGame(Game g) {
		game = g;
	}
	
	public Game getGame() {
		return game;
	}	
}

@@ -21,33 +21,33 @@
 ort 
-javax.persistence.Entity;
+hibernate.HibernateUtil;%0A
 %0Aimp
@@ -68,24 +68,22 @@
 istence.
-OneToOne
+Entity
 ;%0Aimport
@@ -101,36 +101,18 @@
 istence.
-PrimaryKeyJoinColumn
+Id
 ;%0Aimport
@@ -160,20 +160,27 @@
 (name = 
-Game
+MinesWeeper
 .TABLE)%0A
@@ -263,31 +263,96 @@
 ;%0A%0A%09
-public MinesWeeper() %7B%7D
+@Id%0A%09private int id;%0A%09%0A%09public MinesWeeper() %7B%0A%09%09id = 0;%0A%09%09HibernateUtil.save(this);%0A%09%7D%09
 %0A%09%0A%09
@@ -513,217 +513,130 @@
 ;%0A%09%7D
-%0A
 %09%0A%09
-@OneToOne%0A    @PrimaryKeyJoinColumn(name = %22id_game_fk%22, referencedColumnName = %22id_game%22)    %0A%09private Game game;%0A%09public void setGame(Game g) %7B%0A%09%09game = g;%0A%09%7D%0A%09%0A%09public Game getGame() %7B%0A%09%09return game
+%0A%09public int getId () %7B%0A%09%09return id;%0A%09%7D%0A%09%0A%09public void setId (int id) %7B%0A%09%09this.id = id;%0A%09%09HibernateUtil.update(this)
 ;%0A%09%7D
-%09
 %0A%7D%0A

Set minesweeper class pKey