When I work with HQL in IntelliJ IDEA it always highlights my Hibernate queries:
I know the way how I can disable that highlighting, that is already described here.
But I want to know is there a support of HQL in IntelliJ IDEA? Is there any way to use something like query auto-completion?
Maybe an option in settings or some plugin.
Jetbrains / Intellij provides coding assistance, such as syntax highlighting, in string literals via Language Injection.
You can set the language to be injected via Settings > Editor > Language Injections.
In your case you need to set the language for org.hibernate.Session to Hibernate QL / HQL. I had to do the same thing for javax.persistance.EntityManager.
Here is what for me resolve the same issue: Open in the IDEA Preferences (Settings)/Editor/Language Injections and under the list of languages find Session (org.hibernate). Under the column Language, it should be selected Hibernate QL. Double click on it and a list of operations will be displayed. Select the operations that you need.
Related
I'm using this plugin for intelliJ
Database Navigator
I just wanted a simple tool to check my sqlite database, now that the firefox plugin I use is no longer working with the latest firefox update.
Sad!
Anyway, the plugin is good... except it seems to have added it's own "clever" sql checker, that finds all the sql in my java files, and then tells me if there are problems with the sql.
All well and good, but this
slows down editing those java files
doesn't work, finding phantom errors
isn't needed. Who struggles with writing sql?
So right now I have a bunch of red "tick" marks down the side of any java file with sql in it, as the plugin imagines up issues where there are none. I'd like these to just go away, I don't need code telling me if my code works - any ideas
how?
Here is an example of this thing:
I don't want the sql "string" to be treated as special, I don't want "analysis" performed on it, I can write working SQL.
Every time i load this class, the ... whatever it is takes up time looking at all the strings, and then makes EVERYTHING red on the sidebar. I don't want to disable all inspections on this page, as I do like to see when my java code has an error.
I know it is possible to tell intellij to stop looking at strings, I had this setting before - and then my laptop was stolen, thank you thieves - and now I have setup my environment again, I don't have my notes on how to resolve this issue.
The strings are "analyzed" when they are used in some methods of the package java.sql.
Click on a string and press Alt+Enter to expand the suggestion list
Select "Language Injection Settings" to open the configuration dialog for "SQL"
Uncheck all the checkboxes, press "OK" and all errors must be gone
Technical note: Settings are stored in <USER>/<.IDE_VERSION>/config/options/IntelliLang.xml
SQL dialect is not configured
this is mine mapper.xml,i want to clear Warning
Anytime you get the light bulb, if you hit AltEnter / ⌥↵ you will most often get a list of quick-fixes (or intentions). In this case you will should get an option to inject the language, or to edit the language injection settings. It's not clear what type of file you are editing in your screenshot (it's obviously some type of XML like markup). So I'm not 100% sure which quick fix (if any) will be available in that context.
You can also take a look at this SO answer -- https://stackoverflow.com/a/30759243/1348743 -- of mine as it provides a lot more detail about other ways of configuring SQL dialects. Also look at the IntelliJ IDEA help documentation on Using Language Injections.
idea -> setting -> SQL dialect
sql dialect
see the right column 'sql dialect',default value is 'Generic'.
change it to your own db name
I'm able to automate using webdriver but there are few syntax like
driver.manage().setscriptTimeout(100, Seconds);
(copied from other site). How to know that after manage(), setscriptTimeout() follows?
That means how to predict correct methods for timeouts or something like that in webdriver.
Copy paste can be done, but few companies doesn't prefer copy paste job, they need genuine testers who can put the syntax in brain. Please let me know how to master syntax.
What language are you using? An IDE such as IntelliJ (Java), Rubymine(Ruby), Visual STudio(C#), etc. will give you auto complete (also known as Intellisense)
I made a test case with Selenium IDE that makes 25 addresses using a while-loop; starting with housenumber 1.
What I actually would like is that the maximum housenumber is picked up from the database, so we can reuse this case endlessly.
In SQL: select max(housenumber) from tbl_address where streetname = ‘Testingstreet’;
Is this possible, and if so… how?.
(As Slanec pointed out, the comments should probably be an answer).
This is way outside the scope of the IDE. You have reached a point where the IDE is not capable of doing what you want your tests to do, therefore you will either have to workaround this issue somehow, or (better IMO), scrap the IDE altogether and use WebDriver & a programming language directly.
I would use the IDE to export your current tests into whatever language you want, then use the language to find out some library or API that allows you to connect to the database.
Usually, keeping to the same programming language and database libraries as your application under test uses, is a good idea.
One way around the limitations in IDE is to create an internal webpage that you can pass queries through to your db and return the response as a table. Interacting through that page would get you the data you need.
Like the answers before me, I suggest going with the WebDriver, but if you MUST use IDE this could be a solution for you!
There is the simple interpretive programming language and, actually, console interpreter.exe.
Need to make colorizing of syntax, autocomplete and executing by press F5.
(if it is possible to make 'debug' - that will be awesome!)
I never did such things.
There are many IDE, which allow to add lang.: eclipse, NetBeans, emacs, ...
But I did not found complete instruction to add or they are ununderstandable.
What IDE is best to use? to add lang. as easy as possible?
(it will be cool, if IDE can work in Windows)
How to add my language there?
Please, if it is possible to give complete instruction.
Depending on how far you really want to go there are multiple options:
Dumb Autocompletion for text editors:
There are editors like scite aka Notepad++, that take a simple textfile with all the keywords to give you autocompletion, but they don't take into account the syntax nor the context. All they do is to highlight the words they know (e.g. you have given to them) and to autocomplete just these terms.
Smarter Syntax Highlighting:
This would require you to get used to the tools lex and yacc, if we are talking open source. I don't know which proprietary source tools are out there. If you want to get into that, there are several good pages on that topic, and this is one of them.
Compile it all the time:
A simple but effective method for small projects would be just to compile it once every few seconds, and interpret the output. This would be the messy version, but might be fun to look into.
The documentation for adding a new editor to Eclipse looks fairly straightforward:
http://wiki.eclipse.org/FAQ_How_do_I_write_an_editor_for_my_own_language%3F
This covers syntax color highlighting and autocomplete. I imagine you can also create a launch profile in the same plugin