01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */
19: package org.apache.openjpa.persistence.models.company.idclass;
20:
21: import java.util.*;
22: import javax.persistence.*;
23: import org.apache.openjpa.persistence.models.company.*;
24:
25: @Entity(name="IDC_Product")
26: public class Product implements IProduct {
27: private static int ids = 1;
28:
29: @Id
30: private int id = ++ids;
31:
32: @Basic
33: private String name;
34:
35: @Basic
36: private byte[] image;
37:
38: @Basic
39: private float price;
40:
41: @ManyToMany
42: private Set<Company> distributors = new HashSet<Company>();
43:
44: public void setName(String name) {
45: this .name = name;
46: }
47:
48: public String getName() {
49: return this .name;
50: }
51:
52: public void setImage(byte[] image) {
53: this .image = image;
54: }
55:
56: public byte[] getImage() {
57: return this .image;
58: }
59:
60: public void setPrice(float price) {
61: this .price = price;
62: }
63:
64: public float getPrice() {
65: return this .price;
66: }
67:
68: public void setDistributors(Set<? extends ICompany> distributors) {
69: this .distributors = (Set<Company>) distributors;
70: }
71:
72: public Set<Company> getDistributors() {
73: return this.distributors;
74: }
75: }
|