Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions backend-app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'io.jmix' version '2.4.0'
id 'io.jmix' version '2.5.0-M1'
id 'java'
id 'org.jetbrains.gradle.plugin.idea-ext' version '1.1.9'
}
Expand All @@ -8,13 +8,14 @@ apply plugin: 'org.springframework.boot'
apply plugin: 'com.vaadin'

jmix {
bomVersion = '2.4.0'
bomVersion = '2.5.999-SNAPSHOT'
}

group = 'com.company'
version = '0.0.1-SNAPSHOT'

repositories {
mavenLocal()
mavenCentral()
maven {
url 'https://global.repo.jmix.io/repository/public'
Expand Down
1 change: 0 additions & 1 deletion backend-app/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ ui.login.defaultUsername = admin
ui.login.defaultPassword = admin

jmix.core.available-locales = en
jmix.core.fetch-plans-config=com/company/backend/fetch-plans.xml

# Launch the default browser when starting the application in development mode
vaadin.launch-browser = false
Expand Down
14 changes: 0 additions & 14 deletions backend-app/src/main/resources/com/company/backend/fetch-plans.xml

This file was deleted.

16 changes: 1 addition & 15 deletions doc/modules/separate-tiers-guide/pages/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -141,27 +141,13 @@ include::example$/frontend-app/src/main/java/com/company/frontend/entity/Departm
[[fetch-plans]]
=== Fetch Plans

The generic REST API xref:rest:entities-api/load-entities.adoc#fetch-plans[currently supports] only named fetch plans defined in xref:data-access:fetching.adoc#creating-fetch-plans[fetch plans repository]. So the Backend and Frontend applications contain identical fetch plans and use their names when loading data.

[source,xml,indent=0]
.backend-app/src/main/resources/com/company/backend/fetch-plans.xml
----
include::example$/backend-app/src/main/resources/com/company/backend/fetch-plans.xml[]
----

[source,xml,indent=0]
.frontend-app/src/main/resources/com/company/frontend/fetch-plans.xml
----
include::example$/frontend-app/src/main/resources/com/company/frontend/fetch-plans.xml[]
----
Since Jmix 2.5, the generic REST API supports both named fetch plans defined in xref:data-access:fetching.adoc#creating-fetch-plans[fetch plans repository] and inline fetch plans defined in view descriptors or created programmatically. So the Backend and Frontend applications use fetch plans for JPA and DTO entities in the same way.

[[views]]
=== Views

The Frontend views are mostly identical to the views of the basic Onboarding application, with the following differences:

* Named fetch plans are used instead of inline fetch plans.

* `MyOnboardingView` defines the query in the JSON format of the REST API instead of JPQL:
+
[source,xml,indent=0]
Expand Down
5 changes: 3 additions & 2 deletions frontend-app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'io.jmix' version '2.4.0'
id 'io.jmix' version '2.5.0-M1'
id 'java'
id 'org.jetbrains.gradle.plugin.idea-ext' version '1.1.9'
}
Expand All @@ -8,13 +8,14 @@ apply plugin: 'org.springframework.boot'
apply plugin: 'com.vaadin'

jmix {
bomVersion = '2.4.0'
bomVersion = '2.5.999-SNAPSHOT'
}

group = 'com.company'
version = '0.0.1-SNAPSHOT'

repositories {
mavenLocal()
mavenCentral()
maven {
url 'https://global.repo.jmix.io/repository/public'
Expand Down
2 changes: 0 additions & 2 deletions frontend-app/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ jmix.restds.authentication-provider-store = backend
# end::auth-provider-store[]
# end::rest-data-store[]

jmix.core.fetch-plans-config=com/company/frontend/fetch-plans.xml

main.datasource.url = jdbc:hsqldb:file:.jmix/hsqldb/frontendapp
main.datasource.username = sa
main.datasource.password =
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
focusComponent="form">
<data>
<instance id="departmentDc"
class="com.company.frontend.entity.Department"
fetchPlan="department-with-hrManager">
class="com.company.frontend.entity.Department">
<fetchPlan extends="_base">
<property name="hrManager" fetchPlan="_base"/>
</fetchPlan>
<loader/>
</instance>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
focusComponent="departmentsDataGrid">
<data>
<collection id="departmentsDc"
class="com.company.frontend.entity.Department"
fetchPlan="department-with-hrManager">
class="com.company.frontend.entity.Department">
<fetchPlan extends="_base">
<property name="hrManager" fetchPlan="_base"/>
</fetchPlan>
<loader id="departmentsDl" readOnly="true"/>
</collection>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@
focusComponent="form">
<data>
<instance id="userDc"
class="com.company.frontend.entity.User"
fetchPlan="user-full">
class="com.company.frontend.entity.User">
<fetchPlan extends="_base">
<property name="department" fetchPlan="_base"/>
<property name="steps" fetchPlan="_base">
<property name="step" fetchPlan="_base"/>
</property>
</fetchPlan>
<loader/>
<collection id="stepsDc" property="steps"/>
</instance>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
focusComponent="usersDataGrid">
<data>
<collection id="usersDc"
class="com.company.frontend.entity.User"
fetchPlan="user-with-department">
class="com.company.frontend.entity.User">
<fetchPlan extends="_base">
<property name="department" fetchPlan="_base"/>
</fetchPlan>
<loader id="usersDl" readOnly="true"/>
</collection>
</data>
Expand Down
26 changes: 26 additions & 0 deletions jmix-studio.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@
<project version="4">
<component name="JmixDataStoreSettingsManager">
<moduleSettings>
<entry key="backend-app.main">
<ModuleSettings>
<option name="dataStoreOptionsV2">
<map>
<entry key="main">
<value>
<DataStoreSettingsV2 />
</value>
</entry>
</map>
</option>
</ModuleSettings>
</entry>
<entry key="com.company.backend-app.main">
<ModuleSettings>
<option name="dataStoreOptionsV2">
Expand Down Expand Up @@ -32,6 +45,19 @@
</option>
</ModuleSettings>
</entry>
<entry key="frontend-app.main">
<ModuleSettings>
<option name="dataStoreOptionsV2">
<map>
<entry key="main">
<value>
<DataStoreSettingsV2 />
</value>
</entry>
</map>
</option>
</ModuleSettings>
</entry>
</moduleSettings>
</component>
</project>