Title: JPA @ManyToOne, FetchType.LAZY and FetchMode.SELECT do not load original Parent object
Tags: java;jpa;orm;many-to-one
Question: In my bi-direction JPA association between my Parent-child; I am trying to Lazy load my Parent from my Child Entity through a ManyToOne association.

While I debug, I do get the javaassist Proxy object(something like ```Trade_$$_javaassist_41```) which is always a blank object. When I click the Proxy object, JPA does execute the select Query also, but ultimately, no binding happens with the original Parent Object(tradeBean).

Lazy loading the child entity from Parent(OneToMany) doesn't have such issues and child loads without fail.

Parent Entity(Trade)

```@OneToMany(mappedBy="tradeBean", fetch=FetchType.LAZY, cascade=CascadeType.ALL})
@Fetch(FetchMode.SELECT)
private Set<Product&gt; products = new LinkedHashSet<Product&gt;();
```

Child Entity(Product)

```@ManyToOne(fetch=FetchType.LAZY, targetEntity=Trade.class)
@JoinColumn(name="Trade", referencedColumnName="TradeID", insertable=false, updatable=false)
@Fetch(FetchMode.SELECT)
private Trade tradeBean;
```

EntityManager Retrieval

```EntityManager manager  = getEntityManager();
productObj = manager.find(Product.class, productPrimarykey);
if (productObj != null){
    productObj.getTradeBean().getTradeID();
}
manager.detach(productObj);         
return productObj;
```

Question JPA/Hibernate proxy not fetching real object data, sets all properties to null has the similar problem statement but there are no final members in my entities.

Comment: With or without `targetEntity=Trade.class`; didn't make any difference.

Comment: In General.
In Debug mode i could only see that the Lazy load is indeed happening when i click the entity association. Select query was being executed but still the binding of original object to proxy object is not happening.

Comment: Is the problem occurring only in the debugger or in general?

Comment: targetEntity=Trade.class?????



{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 0, 'CommentCount': 4, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2016:00:05/24/16', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<java><jpa><orm><many-to-one>', 'Title': 'JPA @ManyToOne, FetchType.LAZY and FetchMode.SELECT do not load original Parent object', 'ViewCount': 1052, 'id': 37406597, 'user_AboutMe': '<ul>\n<li>Graphic Designer-Flash Animator turned Java Developer with extensive\nexperience in Eterprise Solution Design and Development. </li>\n<li>Primary skilled in Java, Oracle, IBM-MQ/Tibco-EMS, Rest-Services. </li>\n<li>DevOps practitioner.</li>\n<li>Open source Development supporter and believes in contributing back to Development Community.</li>\n</ul>\n', 'user_AccountId': 2155248.0, 'user_DisplayName': 'DeludedPsyche', 'user_Reputation': 131.0, 'user_Views': 14.0, 'user_id': 2732077.0}}