DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
Issue Details (XML | Word | Printable)

Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Andy Jefferson
Reporter: Andy Jefferson
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
DataNucleus Store RDBMS

Allow user to specify that fetch of a 1-1 FK field should only fetch the FK (and not the fields of the related object)

Created: 14/Jul/10 10:52 AM   Updated: 20/Oct/10 09:30 AM   Resolved: 14/Jul/10 10:55 AM
Component/s: Queries
Affects Version/s: None
Fix Version/s: 2.2.0.m1

 Description  « Hide
If we have a class A that has a field "b" of type B and we query for A's and "b" is in the fetch plan, then we may just want to fetch the FK of the "B".

Sort Order: Ascending order - Click to sort in descending order
Andy Jefferson added a comment - 14/Jul/10 10:55 AM
SVN trunk now supports a metadata extension on the field/property of "fetch-fk-only".

Chris Colman added a comment - 21/Jul/10 12:27 AM
Should this be the default when no fetch plans are specified? There's no real advantage to fetching stuff that may not be needed for the immediate operation.

Does the case of not specifying this option mean an effective 'fetch by reachability' for 1-1 relationships?

Say A has a 1-1 relationship with B which has a 1-1 relationship with C:

A -> B -> C

By loading A would C therefore be loaded?

I realize these types of extensive 1-1 relationships are probably rare.