QueryDSL funcionality

Hello,
I am trying to dynamically add and remove where clauses. QueryDsl seems like an appropriate addon to avoid writing all the queries for every interaction. But the examples and exercises don’t provide much help.
I tried to import as directed, but the objects that the examples use are not available on my project

I am new to gradle, and really can’t troubleshoot it too extensively.
the build fails, and no aspects of the plugin seem to be running properly

image

Can I use Criteriabuilder/specification on Cuba?!

Hello, thanks for you question. You are trying to use QueryDSL on Web layer, but the component available only on Core.

My recommendation is to create Service and ServiceBean on core layer, inject dependency (TransactionDataManager, Metadata) and move your code

thank you, that was really helpful.

Still, I am trying to use it as you directed, but I am having trouble following the examples.

image

I am following the examples on this link:

but I really don’t know what either QOrder or QOrderStorageItem is, because I cant use the entities, inject or access them.

Also, I tried importing the project directly as stated on

and it did not work at all, So I ended up just adding the dependency:

but none of this is working for me at all.

And after you add dependency, you do Build project again?
Classes named Q[ClassName] are generated automatically when the project is rebuilt with QueryDSL Addon.

Thank you for your response.

I am completely new to Gradle, it’s hard to troubleshoot.

I try to rebuild the project but I get an error:

> Task :dynamoform-core:test    
com.dynamoware.dynamoform.core.SampleIntegrationTest > initializationError FAILED
    java.lang.IllegalStateException at SampleIntegrationTest.java:28

1 test completed, 1 failed

> Task :dynamoform-core:test FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':dynamoform-core:test'.
> There were failing tests. See the report at: file:///C:/Users/XXXXXX/StudioProjects/dynamoform/modules/core/build/reports/tests/test/index.html

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.6.4/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 19s
15 actionable tasks: 1 executed, 14 up-to-date
5:12:40 PM: Task execution finished 'build'.

I have no idea what that SampleIntegrationTest is doing!

If you see anything I might be missing I’d appreciate it!

Hello, I can’t help you with the problem of SampleIntegrationTest, because it isn’t a part of QueryDSL AppComponent. But Gradle could be run without test java - Gradle build without tests - Stack Overflow

Let’s return to your code. I see many red symbols on your screenshot.
image

Firstly you should Inject TransactionDataManager (with name txDm) and Metadata (with name metadata) into you Component (Service).

Next step, remove or comment the code in listTemplate method and build project. It is needed to build project for the first time after querydsl-cuba component added.

Return code to the method.

Of course the steps will helpful only if you have entities Order, OrderStorageItem, Storage and your method placed on core layer

Hi,

Note that you can not “just add the dependency”.
You need to follow all installation and configuration steps, like described in the Readme:

Otherwise the add-on will not work, auxiliary “QXxx” classes won’t be generated.