Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle TopLink
11g Release 1 (11.1.1)

E28847-01


org.eclipse.persistence.jpa.jpql
Interface ContentAssistProposals

All Known Implementing Classes:
DefaultContentAssistProposals

public interface ContentAssistProposals

This object stores the various proposals available for content assist for a certain position within a JPQL query. The proposals are stored in categories (abstract schema types, identifiers, identification variables and mappings).

Since:
2.3
Version:
2.3
Author:
Pascal Filion

Method Summary
 java.lang.Iterable<IEntity> abstractSchemaTypes()
          Returns the collection of possible abstract schema types.
 ResultQuery buildEscapedQuery(java.lang.String jpqlQuery, java.lang.String proposal, int position, boolean insert)
          Creates a new JPQL query by inserting the given proposal at the given position.
 ResultQuery buildQuery(java.lang.String jpqlQuery, java.lang.String proposal, int position, boolean insert)
          Creates a new JPQL query by inserting the given proposal at the given position.
 IEntity getAbstractSchemaType(java.lang.String identificationVariable)
          Retrieves the abstract schema type that is mapped with the given identification variable.
 boolean hasProposals()
          Determines whether there is at least one proposals.
 java.lang.Iterable<java.lang.String> identificationVariables()
          Returns the collection of possible identification variables.
 java.lang.Iterable<java.lang.String> identifiers()
          Returns the collection of possible JPQL identifiers.
 java.lang.Iterable<IMapping> mappings()
          Returns the collection of possible mappings, which can be state fields, association fields and/or collection fields depending on the location used to retrieve the possible proposals.

 

Method Detail

abstractSchemaTypes

java.lang.Iterable<IEntity> abstractSchemaTypes()
Returns the collection of possible abstract schema types.
Returns:
The entities defined in the persistence context

buildEscapedQuery

ResultQuery buildEscapedQuery(java.lang.String jpqlQuery,
                              java.lang.String proposal,
                              int position,
                              boolean insert)
Creates a new JPQL query by inserting the given proposal at the given position. The resulted JPQL query and position will be adjusted by converting the escaped characters escaped to string values, which means '\r' will have been converted to '\\r.

TODO: TO REWORD: If the proposal is has more than one identifier, for instance, IS NOT NULL, then the replacement will go further than just replacing the current word. If the cursor is in "IS NOT N|" and the proposal is "IS NOT NULL", then "IS NOT" will not be added twice. If the identifier is "IS NULL" and the proposal is "IS NOT NULL", then NOT will be inserted between IS and NULL.

Parameters:
jpqlQuery - The JPQL query to insert the given proposal
proposal - The proposal to insert into the query
position - The position of insertion
insert - Flag that determines if the partial word following the cursor should be left intact or replaced by the proposal
Returns:
The result of inserting the proposal into the query, including the adjust position, if it was required

buildQuery

ResultQuery buildQuery(java.lang.String jpqlQuery,
                       java.lang.String proposal,
                       int position,
                       boolean insert)
Creates a new JPQL query by inserting the given proposal at the given position.

TODO: TO REWORD: If the proposal is has more than one identifier, for instance, IS NOT NULL, then the replacement will go further than just replacing the current word. If the cursor is in "IS NOT N|" and the proposal is "IS NOT NULL", then "IS NOT" will not be added twice. If the identifier is "IS NULL" and the proposal is "IS NOT NULL", then NOT will be inserted between IS and NULL.

Parameters:
jpqlQuery - The JPQL query to insert the given proposal
proposal - The proposal to insert into the query
position - The position of insertion
insert - Flag that determines if the partial word following the cursor should be left intact or replaced by the proposal
Returns:
The result of inserting the proposal into the query, including the adjust position, if it was required

getAbstractSchemaType

IEntity getAbstractSchemaType(java.lang.String identificationVariable)
Retrieves the abstract schema type that is mapped with the given identification variable.
Parameters:
identificationVariable - The identification variable that, if defined as a range variable, will be mapped to a managed type
Returns:
The abstract schema type mapped with the given identification variable or null if the given variable is mapped to something else or not mapped to anything

hasProposals

boolean hasProposals()
Determines whether there is at least one proposals.
Returns:
true if there is at least one proposal; otherwise false

identificationVariables

java.lang.Iterable<java.lang.String> identificationVariables()
Returns the collection of possible identification variables.
Returns:
The list of possible identification variables

identifiers

java.lang.Iterable<java.lang.String> identifiers()
Returns the collection of possible JPQL identifiers.
Returns:
The list of possible JPQL identifiers

mappings

java.lang.Iterable<IMapping> mappings()
Returns the collection of possible mappings, which can be state fields, association fields and/or collection fields depending on the location used to retrieve the possible proposals.
Returns:
The list of possible proposals mappings

Skip navigation links

Copyright © 1998, 2012, Oracle. All Rights Reserved.