jakartaee / jakartaee/persistence

Join map key

Open
#164 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
268
Forks
78
Avg merge
1d 6h
Merged PRs (30d)
13

Description

`MapJoin.key()` return a Path which can not be a join source. For example,

```java
@Entity
public class Store {
@ElementCollection(fetch=FetchType.LAZY)
Map inventory;
}

@Entity
public class Merchandise {
@ManyToOne
Supplier supplier;
}

CriteriaQuery criteriaQuery = criteriaBuilder.createCriteriaQuery(Store.class);
Root root = criteriaQuery.from(Store.class);
root.joinMap("inventory").key().join("supplier");
```

The `key()` return a `Path` that can not join any association or element collection. Join source must be a `From`.

1. need a way to specify the lazy fetch type for map key (Merchandise)?
2. need a way to join or join fetch map key (Merchandise)?

Contributor guide

Open the contributing guide

Research direction

Start with the MapJoin.key(), Path, and From entry points described in the issue, using the Store, Merchandise, and inventory example as the reproduction. Determine the API change needed to make a map key usable for joining or fetching and to specify lazy fetching, then verify that the supplier join and map-key behavior are covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
database
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.