Showing posts with label IDEA. Show all posts
Showing posts with label IDEA. Show all posts

Monday, March 29, 2010

Using HQL Console for JPA facet in Intellij

You got a complicated HQL or JPAQL in your code that has some problems, you need to verify what exactly the query is doing, how should you go ahead to test run it in your database? One option is that you can read the HQL or JPAQL and manually translate it to SQL statement and run the sql statement in your Database, however, this method is error prone and tedious. Another option is use the HQL Console came with Intellij, I found this method is easy and more accurate comparing to the previous options. Here is how I did it:
  • Create a DataSource in Intellij, let's name it datasource_1
  • Go to the Project->View:J2EE structure->right click the module your pojos are located in, edit the JPA facet properties to set datasource_1 maps to the desired Persistent Unit, and set the default JPA provider to: Hibernate.
  • Project->View:J2EE structure->right click the Persistent Unit, you should be able to start HQL Console.
  • You can paste your HQL or JPAQL in the HQL Console and try it out, or you can generate SQL for it and run the SQL in your DB.
Update: In Intellj 9, there is a little bit change where you can find the Persistent Unit to start HQL Console, you should click the Persistence tab on the left corner of Intellij 9.

Wednesday, July 18, 2007

Regex back references

When use Intellij to search/replace by using Regex, you need to notice that the back reference is $n rather than \n.
Refer to Intellij Help on search/repalce.
Refer to here.

Monday, April 09, 2007

IntelliJ supports UTF-8?

One of my colleague complained that the IntelliJ does not support UTF-8 correctly:
  1. System.out.println("Dealer Caterpillar ciężkiego używanego wyposażenia i używanych części"); when you run it, the special character corrupted.
  2. After you safe the java file, restart the Intellij, the special character corrupted.
Here is my trick: In Intellij Settings->General->Default encoding, choose UTF-8 and restart, the java file will be stored in UTF-8 encoding.

Tuesday, April 03, 2007

IDEA does not follow the Goto Implementation for EJB?

Check whether your module is correcly configured as an EJB module.
Project Structure->Modules->XXXEJB module->Ejb Module Settings
check whether your EJB module deployment descriptor setting exists or not, if not, then Add it.

Full Guide for using Bitnami Prometheus Operator Helm Chart with Additional Scrape Configuration

"The Prometheus Operator for Kubernetes provides easy monitoring definitions for Kubernetes services and deployment and management of...