48 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-15 16:52:21 +01:00
@Data
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "t_studios")
@XmlRootElement
@NamedQueries({
@NamedQuery(
name = "Studios.getIdByProperties",
query = "SELECT a FROM Studios a WHERE " +
"a.countrycode LIKE :countrycode AND " +
"a.name LIKE :name AND " +
"a.postcode LIKE :postcode"
),
@NamedQuery(
name = "Studios.selectAllStudios",
query = "SELECT n FROM Studios n"
)
})
2019-11-15 16:52:21 +01:00
public class Studios {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
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 Studios(String name, String countrycode, String postcode) {
this(null, name, countrycode, postcode);
}
}