50 lines
1.1 KiB
Java
Raw Normal View History

2019-11-15 16:52:21 +01:00
package at.technikumwien.movies;
import lombok.*;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
2019-11-29 15:15:08 +01:00
import javax.xml.bind.annotation.XmlTransient;
2019-11-15 16:52:21 +01:00
@Data
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "t_studios")
@XmlRootElement
@NamedQueries({
@NamedQuery(
name = "Studios.getIdByProperties",
query = "SELECT a FROM Studio a WHERE " +
"a.countrycode LIKE :countrycode AND " +
"a.name LIKE :name AND " +
"a.postcode LIKE :postcode"
),
@NamedQuery(
name = "Studios.selectAllStudios",
query = "SELECT n FROM Studio n"
)
})
public class Studio {
2019-11-15 16:52:21 +01:00
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@XmlAttribute
2019-11-15 16:52:21 +01:00
private Long id;
@Column(length = 100, nullable = false)
@XmlAttribute
2019-11-15 16:52:21 +01:00
private String name;
@XmlAttribute
2019-11-15 16:52:21 +01:00
private String countrycode;
@XmlAttribute
2019-11-15 16:52:21 +01:00
private String postcode;
public Studio(String name, String countrycode, String postcode) {
2019-11-15 16:52:21 +01:00
this(null, name, countrycode, postcode);
}
}