Top Description Inners Methods
org.eclipse.persistence.jpa.jpql.tools

public Interface ContentAssistProposals

Known Direct Implementers
org.eclipse.persistence.jpa.jpql.tools.DefaultContentAssistProposals
Imports
org.eclipse.persistence.jpa.jpql.parser.IdentifierRole, org.eclipse.persistence.jpa.jpql.tools.spi.IEntity, .IMapping, .IType

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).

Provisional API: This interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.

Author
Pascal Filion
Since
2.3
Version
2.5

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
ContentAssistProposals.ClassType

This enumeration determines the type of classes returned by ContentAssistProposals#classNames().

public static interface
ContentAssistProposals.EnumProposals

Holds onto the IType of the enum type and the list of possible enum constants.

Method Summary

Modifier and TypeMethod and Description
public Iterable<IEntity>

Returns:

The entities defined in the persistence context
abstractSchemaTypes
()

Returns the collection of possible abstract schema types.

public ResultQuery

Returns:

The result of inserting the proposal into the query, including the adjust position, if it was required
buildEscapedQuery
(String
The JPQL query to modify with the given proposal
jpqlQuery
,
String
The proposal to insert into the query
proposal
,
int
The position of insertion
position
,
boolean
Flag that determines if the partial word following the cursor should be left intact or should be replaced by the proposal
insert
)

Creates a new JPQL query by inserting the given proposal at the given position.

public ResultQuery

Returns:

The result of inserting the proposal into the query, including the adjust position, if it was required
buildQuery
(String
The JPQL query to modify with the given proposal
jpqlQuery
,
String
The proposal to insert into the query
proposal
,
int
The position of insertion
position
,
boolean
Flag that determines if the partial word following the cursor should be left intact or should be replaced by the proposal
insert
)

Creates a new JPQL query by inserting the given proposal at the given position.

public ResultQuery

Returns:

The result of inserting the proposal into the query, including the adjust position, if it was required
buildXmlQuery
(String
The JPQL query to modify with the given proposal, which should be the non- converted string, i.e. any escaped characters should not be converted
jpqlQuery
,
String
The proposal to insert into the query
proposal
,
int
The position of insertion, which was derived from the parsed tree representation of the JPQL query
position
,
boolean
Flag that determines if the partial word following the cursor should be left intact or should be replaced by the proposal
insert
)

Creates a new JPQL query by inserting the given proposal at the given position.

public Iterable<String>

Returns:

The filtered list of possible class names
classNames
()

Returns the filtered list of possible class names.

public Iterable<String>

Returns:

The filtered list of possible column names
columnNames
()

Returns the filtered list of possible column names.

public Iterable<ContentAssistProposals.EnumProposals>

Returns:

The filtered list of possible enum constant names associated with its enum type
enumConstant
()

Returns the filtered list of possible enum constant names.

public IEntity

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
getAbstractSchemaType
(String
The identification variable that, if defined as a range variable, will be mapped to a managed type
identificationVariable
)

Retrieves the abstract schema type that is mapped with the given identification variable.

public ContentAssistProposals.ClassType
public IdentifierRole

Returns:

The IdentifierRole for the given JPQL identifier or null if no role was defined or if the given string is not a valid JPQL identifier
getIdentifierRole
(String
The JPQL identifier to retrieve its role
identifier
)

Returns the role of the given JPQL identifier.

public boolean

Returns:

true if there is at least one proposal; otherwise false
hasProposals
()

Determines whether there is at least one proposals.

public Iterable<String>

Returns:

The list of possible identification variables
identificationVariables
()

Returns the collection of possible identification variables.

public Iterable<String>

Returns:

The list of possible JPQL identifiers
identifiers
()

Returns the collection of possible JPQL identifiers.

public Iterable<IMapping>

Returns:

The list of possible proposals mappings
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.

public Iterable<String>

Returns:

The filtered list of possible table names
tableNames
()

Returns the filtered list of possible table names.

Method Detail

abstractSchemaTypesback to summary
public Iterable<IEntity> abstractSchemaTypes()

Returns the collection of possible abstract schema types.

Returns:Iterable<IEntity>

The entities defined in the persistence context

buildEscapedQueryback to summary
public ResultQuery buildEscapedQuery(String jpqlQuery, String proposal, int position, boolean insert)

Creates a new JPQL query by inserting the given proposal at the given position. The updated JPQL query and position will be adjusted by converting some characters into their corresponding escaped characters, for instance '\r' will be converted to '\\r.

The replacement will also handle compound JPQL identifiers when updating the JPQL query.

Example: If the cursor is within "IS NOT N|" and the proposal is "IS NOT NULL", then "IS NOT" will not be added twice. If the word to replace is "IS NULL" and the proposal is "IS NOT NULL", then "NOT" will be inserted between "IS" and "NULL".

Parameters
jpqlQuery:String

The JPQL query to modify with the given proposal

proposal:String

The proposal to insert into the query

position:int

The position of insertion

insert:boolean

Flag that determines if the partial word following the cursor should be left intact or should be replaced by the proposal

Returns:ResultQuery

The result of inserting the proposal into the query, including the adjust position, if it was required

buildQueryback to summary
public ResultQuery buildQuery(String jpqlQuery, String proposal, int position, boolean insert)

Creates a new JPQL query by inserting the given proposal at the given position.

The replacement will also handle compound JPQL identifiers when updating the JPQL query.

Example: If the cursor is within "IS NOT N|" and the proposal is "IS NOT NULL", then "IS NOT" will not be added twice. If the word to replace is "IS NULL" and the proposal is "IS NOT NULL", then "NOT" will be inserted between "IS" and "NULL".

Parameters
jpqlQuery:String

The JPQL query to modify with the given proposal

proposal:String

The proposal to insert into the query

position:int

The position of insertion

insert:boolean

Flag that determines if the partial word following the cursor should be left intact or should be replaced by the proposal

Returns:ResultQuery

The result of inserting the proposal into the query, including the adjust position, if it was required

buildXmlQueryback to summary
public ResultQuery buildXmlQuery(String jpqlQuery, String proposal, int position, boolean insert)

Creates a new JPQL query by inserting the given proposal at the given position. The updated JPQL query and position will be adjusted by converting some characters into their corresponding escaped characters, for instance '>' will be converted to '&gt;'.

The replacement will also handle compound JPQL identifiers when updating the JPQL query.

Example: If the cursor is within "IS NOT N|" and the proposal is "IS NOT NULL", then "IS NOT" will not be added twice. If the word to replace is "IS NULL" and the proposal is "IS NOT NULL", then "NOT" will be inserted between "IS" and "NULL".

Parameters
jpqlQuery:String

The JPQL query to modify with the given proposal, which should be the non- converted string, i.e. any escaped characters should not be converted

proposal:String

The proposal to insert into the query

position:int

The position of insertion, which was derived from the parsed tree representation of the JPQL query

insert:boolean

Flag that determines if the partial word following the cursor should be left intact or should be replaced by the proposal

Returns:ResultQuery

The result of inserting the proposal into the query, including the adjust position, if it was required

Since
2.5
classNamesback to summary
public Iterable<String> classNames()

Returns the filtered list of possible class names. This is usually available when the cursor is within the constructor name of the constructor expression.

Returns:Iterable<String>

The filtered list of possible class names

Since
2.5
See Also
org.eclipse.persistence.jpa.jpql.parser.ConstructorExpression
columnNamesback to summary
public Iterable<String> columnNames()

Returns the filtered list of possible column names.

Returns:Iterable<String>

The filtered list of possible column names

Since
2.5
enumConstantback to summary
public Iterable<ContentAssistProposals.EnumProposals> enumConstant()

Returns the filtered list of possible enum constant names. This is usually available when the cursor is after the dot separating a fully qualified enum type and the enum constant.

Returns:Iterable<ContentAssistProposals.EnumProposals>

The filtered list of possible enum constant names associated with its enum type

Since
2.5
getAbstractSchemaTypeback to summary
public IEntity getAbstractSchemaType(String identificationVariable)

Retrieves the abstract schema type that is mapped with the given identification variable.

Parameters
identificationVariable:String

The identification variable that, if defined as a range variable, will be mapped to a managed type

Returns:IEntity

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

getClassTypeback to summary
public ContentAssistProposals.ClassType getClassType()
Since
2.5
getIdentifierRoleback to summary
public IdentifierRole getIdentifierRole(String identifier)

Returns the role of the given JPQL identifier.

Parameters
identifier:String

The JPQL identifier to retrieve its role

Returns:IdentifierRole

The IdentifierRole for the given JPQL identifier or null if no role was defined or if the given string is not a valid JPQL identifier

Since
2.4
hasProposalsback to summary
public boolean hasProposals()

Determines whether there is at least one proposals.

Returns:boolean

true if there is at least one proposal; otherwise false

identificationVariablesback to summary
public Iterable<String> identificationVariables()

Returns the collection of possible identification variables.

Returns:Iterable<String>

The list of possible identification variables

identifiersback to summary
public Iterable<String> identifiers()

Returns the collection of possible JPQL identifiers.

Returns:Iterable<String>

The list of possible JPQL identifiers

mappingsback to summary
public 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:Iterable<IMapping>

The list of possible proposals mappings

tableNamesback to summary
public Iterable<String> tableNames()

Returns the filtered list of possible table names.

Returns:Iterable<String>

The filtered list of possible table names

Since
2.5
org.eclipse.persistence.jpa.jpql.tools back to summary

public final Enum ContentAssistProposals.ClassType

extends Enum<ContentAssistProposals.ClassType>
Class Inheritance

This enumeration determines the type of classes returned by ContentAssistProposals#classNames().

Field Summary

Modifier and TypeField and Description
public static final ContentAssistProposals.ClassType
ENUM

Indicates the only class type allowed is an enum type.

public static final ContentAssistProposals.ClassType
INSTANTIABLE

Indicates the class has to be instantiable, i.e. anonymous, interfaces, enums, annotations are not allowed.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static ContentAssistProposals.ClassType
public static ContentAssistProposals.ClassType[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ENUMback to summary
public static final ContentAssistProposals.ClassType ENUM

Indicates the only class type allowed is an enum type.

INSTANTIABLEback to summary
public static final ContentAssistProposals.ClassType INSTANTIABLE

Indicates the class has to be instantiable, i.e. anonymous, interfaces, enums, annotations are not allowed.

Constructor Detail

ClassTypeback to summary
private ClassType()

Method Detail

valueOfback to summary
public static ContentAssistProposals.ClassType valueOf(String name)
valuesback to summary
public static ContentAssistProposals.ClassType[] values()
org.eclipse.persistence.jpa.jpql.tools back to summary

public Interface ContentAssistProposals.EnumProposals

Known Direct Implementers
org.eclipse.persistence.jpa.jpql.tools.DefaultContentAssistProposals.DefaultEnumProposals

Holds onto the IType of the enum type and the list of possible enum constants.
Version
2.5

Method Summary

Modifier and TypeMethod and Description
public Iterable<String>
enumConstants()

Returns the list of enum constants that have been filtered.

public IType

Returns:

The IType representing the enum type
enumType
()

The IType representing the enum type.

Method Detail

enumConstantsback to summary
public Iterable<String> enumConstants()

Returns the list of enum constants that have been filtered.

enumTypeback to summary
public IType enumType()

The IType representing the enum type.

Returns:IType

The IType representing the enum type