You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/main/asciidoc/hibernate-orm.adoc
+19-1Lines changed: 19 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1817,10 +1817,28 @@ public class MyEntityResource {
1817
1817
repository.insert(entity);
1818
1818
}
1819
1819
1820
-
// ...
1820
+
// ...
1821
+
1822
+
}
1823
+
----
1824
+
1825
+
[NOTE]
1826
+
====
1827
+
When working with non-default persistence units, remember to specify the persistence unit name the repository is targeting
1828
+
in the `dataStore` attribute of the repository annotation:
1821
1829
1830
+
[source,java]
1831
+
----
1832
+
@Repository(dataStore = "other") // <1>
1833
+
public interface MyNonDefaultPURepository {
1834
+
// ...
1822
1835
}
1823
1836
----
1837
+
1. Pass the name of the non-default persistence unit to the repository annotation (`other` in this example).
1838
+
1839
+
Review the https://jakarta.ee/specifications/data/1.0/apidocs/jakarta.data/jakarta/data/repository/repository#dataStore()[Javadoc of the `@Repository` annotation]
1840
+
to learn more about the `dataStore` attribute.
1841
+
====
1824
1842
1825
1843
Please refer to the corresponding https://hibernate.org/repositories/[Hibernate Data Repositories]
1826
1844
and https://jakarta.ee/specifications/data/1.0/jakarta-data-1.0[Jakarta Data]
0 commit comments