-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
151 additions
and
21 deletions.
There are no files selected for viewing
65 changes: 65 additions & 0 deletions
65
...ieldgenerator-test/src/main/java/com/speedment/jpastreamer/fieldgenerator/test/Actor.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,65 @@ | ||
package com.speedment.jpastreamer.fieldgenerator.test; | ||
|
||
import javax.persistence.*; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
@Entity | ||
@Table(name = "actor", schema = "sakila") | ||
public class Actor { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "actor_id", nullable = false, updatable = false, columnDefinition = "smallint(5)") | ||
private Integer actorId; | ||
|
||
@Column(name = "first_name", nullable = false, columnDefinition = "varchar(45)") | ||
private String firstName; | ||
|
||
@Column(name = "last_name", nullable = false, columnDefinition = "varchar(45)") | ||
private String lastName; | ||
|
||
@ManyToMany(mappedBy = "actors") | ||
private List<Film> films = new ArrayList<>(); | ||
|
||
public Integer getActorId() { | ||
return actorId; | ||
} | ||
|
||
public void setActorId(Integer actorId) { | ||
this.actorId = actorId; | ||
} | ||
|
||
public List<Film> getFilms() { | ||
return films; | ||
} | ||
|
||
public void setFilms(List<Film> films) { | ||
this.films = films; | ||
} | ||
|
||
public String getFirstName() { | ||
return firstName; | ||
} | ||
|
||
public void setFirstName(String firstName) { | ||
this.firstName = firstName; | ||
} | ||
|
||
public String getLastName() { | ||
return lastName; | ||
} | ||
|
||
public void setLastName(String lastName) { | ||
this.lastName = lastName; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Actor{" + | ||
"actorId=" + actorId + | ||
", firstName='" + firstName + '\'' + | ||
", lastName='" + lastName + '\'' + | ||
'}'; | ||
} | ||
} |
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
56 changes: 56 additions & 0 deletions
56
...dgenerator-test/src/main/java/com/speedment/jpastreamer/fieldgenerator/test/Language.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,56 @@ | ||
package com.speedment.jpastreamer.fieldgenerator.test; | ||
|
||
|
||
import javax.persistence.*; | ||
import java.io.Serializable; | ||
import java.util.Set; | ||
|
||
@Entity | ||
@Table(name = "language", schema = "sakila") | ||
public class Language implements Serializable { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "language_id", nullable = false, updatable = false, columnDefinition = "tinyint(3)") | ||
private Integer languageId; | ||
|
||
@Column(name = "name", nullable = false, columnDefinition = "char(20)") | ||
private String name; | ||
|
||
@OneToMany(mappedBy = "language") | ||
private Set<Film> films; | ||
|
||
@ManyToMany | ||
public Integer getLanguageId() { | ||
return languageId; | ||
} | ||
|
||
public void setLanguageId(Integer language_id) { | ||
this.languageId = language_id; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public Set<Film> getFilms() { | ||
return films; | ||
} | ||
|
||
public void setFilms(Set<Film> films) { | ||
this.films = films; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Language{" + | ||
"languageId=" + languageId + | ||
", name='" + name + '\'' + | ||
'}'; | ||
} | ||
|
||
} |
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