139.225 strg+space in sql query surrounds with try catch

Hi,

if i press strg+space in a query intellij current line with try catch block:

| is the cursor:

 
public User getUserByName2(String name) {
    return (User) em.createNativeQuery("select * from user u where u.|"
}


becames:

 
public User getUserByName2(String name) {
    try {
        return (User) em.createNativeQuery("select * from user u where u"
    |
} catch (Exception e) {
        e.printStackTrace();
    }
}


User.class

 
@Entity
@NamedQueries({
        @NamedQuery(name = "User.findByName", query = "from User u " +
                "where u.username = :name")
})
public class User implements Serializable {
    @Id
    private
Long id;
    private String username;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }
}


Cheers
cibo

idea:139.225

Please sign in to leave a comment.