Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 372092 | Differences between
and this patch

Collapse All | Expand All

(-)a/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/inherited/Beer.java (-7 / +9 lines)
Lines 15-20 Link Here
15
 *       -311395 : Multiple lifecycle callback methods for the same lifecycle event
15
 *       -311395 : Multiple lifecycle callback methods for the same lifecycle event
16
 *     08/11/2010-2.2 Guy Pelletier 
16
 *     08/11/2010-2.2 Guy Pelletier 
17
 *       - 312123: JPA: Validation error during Id processing on parameterized generic OneToOne Entity relationship from MappedSuperclass
17
 *       - 312123: JPA: Validation error during Id processing on parameterized generic OneToOne Entity relationship from MappedSuperclass
18
 *     10/05/2012-2.4.1 Guy Pelletier 
19
 *       - 373092: Exceptions using generics, embedded key and entity inheritance
18
 ******************************************************************************/  
20
 ******************************************************************************/  
19
package org.eclipse.persistence.testing.models.jpa.inherited;
21
package org.eclipse.persistence.testing.models.jpa.inherited;
20
22
Lines 37-47 import java.sql.Timestamp; Link Here
37
39
38
@MappedSuperclass
40
@MappedSuperclass
39
@ExistenceChecking(CHECK_CACHE)
41
@ExistenceChecking(CHECK_CACHE)
40
public class Beer<G, H, I> extends Beverage<G> {
42
public class Beer<PK, ALCOHOL_CONTENT_TYPE, BeerDoubleType> extends Beverage<PK> {
41
    private Timestamp version;
43
    private Timestamp version;
42
    private H alcoholContent;
44
    private ALCOHOL_CONTENT_TYPE alcoholContent;
43
    private BeerConsumer beerConsumer;
45
    private BeerConsumer beerConsumer;
44
    private I beerDouble;
46
    private BeerDoubleType beerDouble;
45
    
47
    
46
    public static int BEER_PRE_PERSIST_COUNT = 0;
48
    public static int BEER_PRE_PERSIST_COUNT = 0;
47
    public static int BEER_POST_PERSIST_COUNT = 0;
49
    public static int BEER_POST_PERSIST_COUNT = 0;
Lines 66-72 public class Beer<G, H, I> extends Beverage<G> { Link Here
66
    
68
    
67
    @Basic
69
    @Basic
68
    @Column(name="ALCOHOL_CONTENT")
70
    @Column(name="ALCOHOL_CONTENT")
69
    public H getAlcoholContent() {
71
    public ALCOHOL_CONTENT_TYPE getAlcoholContent() {
70
        return alcoholContent;
72
        return alcoholContent;
71
    }
73
    }
72
    
74
    
Lines 79-85 public class Beer<G, H, I> extends Beverage<G> { Link Here
79
    @OneToOne(fetch=LAZY)
81
    @OneToOne(fetch=LAZY)
80
    //@OneToOne
82
    //@OneToOne
81
    @JoinColumn(name="BD_ID")
83
    @JoinColumn(name="BD_ID")
82
    public I getBeerDouble() {
84
    public BeerDoubleType getBeerDouble() {
83
        return beerDouble;
85
        return beerDouble;
84
    }
86
    }
85
    
87
    
Lines 88-94 public class Beer<G, H, I> extends Beverage<G> { Link Here
88
        return version;
90
        return version;
89
    }
91
    }
90
    
92
    
91
    public void setAlcoholContent(H alcoholContent) {
93
    public void setAlcoholContent(ALCOHOL_CONTENT_TYPE alcoholContent) {
92
        this.alcoholContent = alcoholContent;
94
        this.alcoholContent = alcoholContent;
93
    }
95
    }
94
    
96
    
Lines 96-102 public class Beer<G, H, I> extends Beverage<G> { Link Here
96
        this.beerConsumer = beerConsumer;
98
        this.beerConsumer = beerConsumer;
97
    }
99
    }
98
    
100
    
99
    public void setBeerDouble(I beerDouble) {
101
    public void setBeerDouble(BeerDoubleType beerDouble) {
100
        this.beerDouble = beerDouble;
102
        this.beerDouble = beerDouble;
101
    }
103
    }
102
    
104
    
(-)a/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/models/jpa/inherited/Beverage.java (-4 / +6 lines)
Lines 13-18 Link Here
13
 *       - 232975: Failure when attribute type is generic
13
 *       - 232975: Failure when attribute type is generic
14
 *     07/15/2010-2.2 Guy Pelletier 
14
 *     07/15/2010-2.2 Guy Pelletier 
15
 *       -311395 : Multiple lifecycle callback methods for the same lifecycle event
15
 *       -311395 : Multiple lifecycle callback methods for the same lifecycle event
16
 *     10/05/2012-2.4.1 Guy Pelletier 
17
 *       - 373092: Exceptions using generics, embedded key and entity inheritance
16
 ******************************************************************************/  
18
 ******************************************************************************/  
17
package org.eclipse.persistence.testing.models.jpa.inherited;
19
package org.eclipse.persistence.testing.models.jpa.inherited;
18
20
Lines 24-33 import javax.persistence.MappedSuperclass; Link Here
24
import static javax.persistence.GenerationType.*;
26
import static javax.persistence.GenerationType.*;
25
27
26
@MappedSuperclass
28
@MappedSuperclass
27
public class Beverage<T> {
29
public class Beverage<PK> {
28
    public static int BEVERAGE_POST_PERSIST_COUNT = 0;
30
    public static int BEVERAGE_POST_PERSIST_COUNT = 0;
29
    
31
    
30
    private T id;
32
    private PK id;
31
    
33
    
32
    public Beverage() {}
34
    public Beverage() {}
33
    
35
    
Lines 39-49 public class Beverage<T> { Link Here
39
        pkColumnName="SEQ_NAME", 
41
        pkColumnName="SEQ_NAME", 
40
        valueColumnName="SEQ_COUNT",
42
        valueColumnName="SEQ_COUNT",
41
        pkColumnValue="BEVERAGE_SEQ")
43
        pkColumnValue="BEVERAGE_SEQ")
42
    public T getId() {
44
    public PK getId() {
43
        return id;
45
        return id;
44
    }
46
    }
45
    
47
    
46
    public void setId(T id) {
48
    public void setId(PK id) {
47
        this.id = id;
49
        this.id = id;
48
    }
50
    }
49
    
51
    
(-)a/jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/metadata/accessors/objects/MetadataAsmFactory.java (-14 / +29 lines)
Lines 1-7 Link Here
1
package org.eclipse.persistence.internal.jpa.metadata.accessors.objects;
2
3
/*******************************************************************************
1
/*******************************************************************************
4
 * Copyright (c) 1998, 2010 Oracle, Hans Harz, Andrew Rustleund. All rights reserved.
2
 * Copyright (c) 1998, 2012 Oracle, Hans Harz, Andrew Rustleund. All rights reserved.
5
 * This program and the accompanying materials are made available under the 
3
 * This program and the accompanying materials are made available under the 
6
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
4
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
7
 * which accompanies this distribution. 
5
 * which accompanies this distribution. 
Lines 17-23 package org.eclipse.persistence.internal.jpa.metadata.accessors.objects; Link Here
17
 *           DatabaseSessionImpl.initializeDescriptors because @MapKey Annotation is not found.
15
 *           DatabaseSessionImpl.initializeDescriptors because @MapKey Annotation is not found.
18
 *     04/21/2011-2.3 dclarke: Upgraded to support ASM 3.3.1
16
 *     04/21/2011-2.3 dclarke: Upgraded to support ASM 3.3.1
19
 *     08/10/2011-2.3 Lloyd Fernandes : Bug 336133 - Validation error during processing on parameterized generic OneToMany Entity relationship from MappedSuperclass
17
 *     08/10/2011-2.3 Lloyd Fernandes : Bug 336133 - Validation error during processing on parameterized generic OneToMany Entity relationship from MappedSuperclass
18
 *     10/05/2012-2.4.1 Guy Pelletier 
19
 *       - 373092: Exceptions using generics, embedded key and entity inheritance
20
 ******************************************************************************/
20
 ******************************************************************************/
21
package org.eclipse.persistence.internal.jpa.metadata.accessors.objects;
22
21
import java.io.IOException;
23
import java.io.IOException;
22
import java.io.InputStream;
24
import java.io.InputStream;
23
import java.util.ArrayList;
25
import java.util.ArrayList;
Lines 516-531 public class MetadataAsmFactory extends MetadataFactory { Link Here
516
                    }
518
                    }
517
                } else {
519
                } else {
518
                    // Is a generic type variable.
520
                    // Is a generic type variable.
519
                    arguments.add(new String(new char[] { next }));
521
                    int start = index;
520
                    if((index+1) < length) {
522
                    int end = start;
521
                       if(desc.charAt(index+1)==':') {
523
                    
522
                           isGenericTyped=true;
524
                    char myNext = next;
523
                           index ++;
525
                    
524
                           arguments.add(":");
526
                    while (':' != myNext && '(' != myNext && ')' != myNext && '<' != myNext && '>' != myNext && ';' != myNext && end < length - 1) {
525
                           if(desc.charAt(index+1)==':') {
527
                        end++;
526
                               index ++;
528
                        myNext = chars[end];
527
                           }
529
                    }
528
                       }
530
                    
531
                    if (myNext == ':') {
532
                        arguments.add(desc.substring(start, end));
533
                        isGenericTyped=true;
534
                        index = end;
535
                        arguments.add(":");
536
                        if(desc.charAt(index+1)==':') {
537
                            index ++;
538
                        }
539
                    } else if (myNext == ';' && next == 'T') {
540
                        arguments.add(new String(new char[] { next }));
541
                        arguments.add(desc.substring(start + 1, end));
542
                        index = end - 1;
543
                    } else {
544
                        arguments.add(new String(new char[] { next }));
529
                    }
545
                    }
530
                }
546
                }
531
            }
547
            }
532
- 

Return to bug 372092