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.jdbc.annotations;
20:
21: import javax.persistence.*;
22:
23: @Entity
24: @SqlResultSetMapping(name="EmbedMapping",entities={@EntityResult(entityClass=EmbedOwner.class,fields={@FieldResult(name="pk",column="OWNER_PK"),@FieldResult(name="basic",column="OWNER_BASIC"),@FieldResult(name="embed.basic",column="EMBED_BASIC"),@FieldResult(name="embed.clob",column="EMBED_CLOB")})})
25: public class EmbedOwner {
26:
27: @Embedded
28: @AttributeOverride(name="basic",column=@Column(name="OVER_BASIC"))
29: @AssociationOverride(name="owner",joinColumns=@JoinColumn(name="OVER_OWNER"))
30: protected EmbedValue embed;
31:
32: @Basic
33: @Column(name="OWN_BASIC")
34: protected String basic;
35:
36: @Id
37: @GeneratedValue
38: protected int pk;
39:
40: public int getPk() {
41: return pk;
42: }
43:
44: public void setBasic(String basic) {
45: this .basic = basic;
46: }
47:
48: public String getBasic() {
49: return basic;
50: }
51:
52: public void setEmbed(EmbedValue embed) {
53: this .embed = embed;
54: }
55:
56: public EmbedValue getEmbed() {
57: return embed;
58: }
59: }
|