Home > OS >  Dynamic, Typesafe query syntax invalid in VSCode and Eclipse (works in IntelliJ)
Dynamic, Typesafe query syntax invalid in VSCode and Eclipse (works in IntelliJ)

Time:11-04

Let me start by saying I'm learning Java, and come from the .NET/C# world.

TL;DR: This syntax does not work in VSCode or Eclipse IDE, does in IntelliJ. Why? What am I missing?

    import path.to.class.Foo;
    import path.to.class.Foo_; // cannot be resolved error

...

   Foo_.barID; // cannot resolve to a variable

The underscore_ notation just causes the above errors... ugh

Long version:

I work on an API, and my team is newer to the project. None of us JAVA specific devs, and we've learned a ton over the last several months. The original devs created the project using IntelliJ, and supported it using that IDE. Unfortunately, our IntelliJ licenses keep being allowed to expire and it takes a week to get it back, and I'm not good with down time, so I tried Eclipse and VSCode. When trying to debug, the project won't build because some imports are unable to be resolved, as well as some variables that appear to be using JPA 2.0 notation for Dynamic, typesafe queries. Reading the following, this notation appears to have been around a long time, and Eclipse a long time Java IDE, so I think I'm clearly missing something. enter image description here.

Note that with option 2, when you change your entities you'll have to re-run the maven build (at least generate-sources phase) to see the updated generated classes.

CodePudding user response:

Use the Community Edition of IntelliJ as offered by @joopeggen. Proposed answer by @e-riz is a likely secondary answer.

  • Related