Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 366397 - criteria.From.join(..., JoinType.LEFT).getJoinType() does not return JoinType.LEFT
Summary: criteria.From.join(..., JoinType.LEFT).getJoinType() does not return JoinType...
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 blocker (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-12 08:35 EST by Stephen DiMilla CLA
Modified: 2022-06-09 10:27 EDT (History)
3 users (show)

See Also:


Attachments
proposed fix (11.84 KB, patch)
2013-02-06 11:47 EST, Tom Ware CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stephen DiMilla CLA 2011-12-12 08:35:58 EST
Build Identifier: eclipselink-2.3.0.v20110604-r9504

Using the entity:

@Entity
@Table(name="CUSTOMER_TABLE")
public class Customer implements java.io.Serializable
{

    // Instance variables
    private String id;
    private String name;
    public Customer()
    {
    }

    public Customer (String id, String name)
    {
    this.id = id;
    this.name = name;
    }
   @Id
    @Column(name="ID")
    public String getId() {
    return id;
    }
    public void setId(String v) {
    this.id = v;
    }

    @Column(name="NAME")
    public String getName() {
    return name;
    }
    public void setName(String v) {
    this.name = v;
    }
}
----------------------
Using the client code:

            CriteriaBuilder cbuilder = getEntityManager().getCriteriaBuilder();

            getEntityTransaction().begin();
            CriteriaQuery<Customer> cquery = cbuilder.createQuery(Customer.class);
            Root<Customer> customer = cquery.from(Customer.class);

            TestUtil.logMsg("Testing LEFT getJoinType");
            JoinType jt =  customer.join("aliases", JoinType.LEFT).getJoinType();
            if (jt.equals(JoinType.LEFT)){
                System.out.println("Received expected:"+jt.name());
            } else {
                System.out.println("Expected:"+JoinType.LEFT.name()+", actual:"+jt);
            }

---------
output:

Testing LEFT getJoinType
Expected:LEFT, actual:INNER

Reproducible: Always
Comment 1 Tom Ware CLA 2012-04-05 11:01:12 EDT
Updating target milestone.
Comment 2 Tom Ware CLA 2013-02-06 11:47:42 EST
Created attachment 226643 [details]
proposed fix
Comment 3 Tom Ware CLA 2013-02-06 15:43:44 EST
Fix checked in - pass the join type on in FromImpl join calls

Reviewed by Chris Delahunt

Added test to JPA 2.1 Query test suite

Tested with JPA LRG
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:27:18 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink