2019-12-10 15:17:37 +01:00

50 lines
1.1 KiB
Java

package at.technikumwien.movies;
import lombok.*;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
@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 {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@XmlAttribute
private Long id;
@Column(length = 100, nullable = false)
@XmlAttribute
private String name;
@XmlAttribute
private String countrycode;
@XmlAttribute
private String postcode;
public Studio(String name, String countrycode, String postcode) {
this(null, name, countrycode, postcode);
}
}