/*
* Copyright 2015, The Querydsl Team (http://www.querydsl.com/team)
*
* Licensed 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 com.querydsl.jdo.test.domain;
import java.util.Date;
import javax.jdo.annotations.Inheritance;
import javax.jdo.annotations.InheritanceStrategy;
import javax.jdo.annotations.PersistenceCapable;
/**
* Definition of a Book. Extends basic Product class.
*/
@PersistenceCapable
@Inheritance(strategy = InheritanceStrategy.NEW_TABLE)
public class Book extends Product {
private String author = null;
private String isbn = null;
private String publisher = null;
protected Book() {
super();
}
public Book(String name, String description, double price, int amount, String author,
String isbn, String publisher) {
this(name, description, price, amount, author, isbn, publisher, new Date());
}
public Book(String name, String description, double price, int amount, String author,
String isbn, String publisher, Date date) {
super(name, description, price, amount, date);
this.author = author;
this.isbn = isbn;
this.publisher = publisher;
}
public String getAuthor() {
return author;
}
public String getIsbn() {
return isbn;
}
public String getPublisher() {
return publisher;
}
public void setAuthor(String author) {
this.author = author;
}
public void setIsbn(String isbn) {
this.isbn = isbn;
}
public void setPublisher(String publisher) {
this.publisher = publisher;
}
public String toString() {
return "Book : " + author + " - " + getName();
}
}