Class HQLAnalyzer

java.lang.Object
org.hibernate.tool.ide.completion.HQLAnalyzer

public class HQLAnalyzer extends Object
The HQLAnalyzer can answer certain questions about a HQL String.
Author:
leon, max.andersen@jboss.com
  • Constructor Details

    • HQLAnalyzer

      public HQLAnalyzer()
  • Method Details

    • getLexer

      protected SimpleHQLLexer getLexer(char[] chars, int end)
    • getLexer

      protected SimpleHQLLexer getLexer(char[] chars)
    • shouldShowEntityNames

      public boolean shouldShowEntityNames(String query, int cursorPosition)
      Returns true if the position is at a location where an entityname makes sense. e.g. "from Pr| where x"
      Parameters:
      query -
      cursorPosition -
      Returns:
    • shouldShowEntityNames

      public boolean shouldShowEntityNames(char[] chars, int cursorPosition)
    • getVisibleSubQueries

      public List<SubQuery> getVisibleSubQueries(char[] chars, int position)
    • getVisibleEntityNames

      public List<EntityNameReference> getVisibleEntityNames(char[] chars, int position)
    • getSubQueries

      public HQLAnalyzer.SubQueryList getSubQueries(char[] query, int position)
    • getEntityNamePrefix

      public static String getEntityNamePrefix(char[] chars, int position)
      Returns reference name found from position and backwards in the array.