/** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.books.domain; import javax.persistence.*; @Entity @NamedQuery(name = "findBooks", query = "from Book b where lower(b.title) like :title and lower(b.authors) like :author and lower(b.publisher) like :publisher") public class Book { @Id @GeneratedValue(strategy = GenerationType.AUTO) private long id; private String authors; private String publisher; private String title; private int year; private double price; public Book() { } public Book(String author, String title, int year, String publisher) { this.authors = author; this.title = title; this.year = year; this.publisher = publisher; } public String getAuthors() { return authors; } public void setAuthors(String author) { this.authors = author; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public int getYear() { return year; } public void setYear(int year) { this.year = year; } public String getPublisher() { return publisher; } public void setPublisher(String publisher) { this.publisher = publisher; } public void setPrice(double price) { this.price = price; } public double getPrice() { return price; } }