-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'rama-de-union' of https://github.com/CodeURJC-DAW-2019-…
…20/webapp9 into rama-de-union
- Loading branch information
Showing
5 changed files
with
124 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
practica/src/main/java/com/practica/demo/data/player/Player.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package com.practica.demo.data.player; | ||
|
||
import javax.persistence.Entity; | ||
import javax.persistence.Id; | ||
import javax.persistence.OneToOne; | ||
|
||
import com.practica.demo.data.user.User; | ||
|
||
@Entity | ||
public class Player { | ||
|
||
@Id | ||
private int idPlayer; | ||
|
||
@OneToOne | ||
private User user; | ||
|
||
private String description; | ||
|
||
public Player() { | ||
// TODO Auto-generated constructor stub | ||
} | ||
|
||
public int getIdPlayer() { | ||
return idPlayer; | ||
} | ||
|
||
public void setIdPlayer(int idPlayer) { | ||
this.idPlayer = idPlayer; | ||
} | ||
|
||
public User getUser() { | ||
return user; | ||
} | ||
|
||
public void setUser(User user) { | ||
this.user = user; | ||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
} |
12 changes: 12 additions & 0 deletions
12
practica/src/main/java/com/practica/demo/data/player/PlayerRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.practica.demo.data.player; | ||
|
||
import org.springframework.data.repository.CrudRepository; | ||
|
||
import com.practica.demo.data.user.User; | ||
|
||
|
||
public interface PlayerRepository extends CrudRepository<Player, Integer> { | ||
|
||
Player findByuser(User user); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters