Package org.apache.openjpa.jdbc.sql
Class SelectImpl.Selects
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList
-
- org.apache.openjpa.jdbc.sql.SelectImpl.Selects
-
- All Implemented Interfaces:
java.lang.Iterable
,java.util.Collection
,java.util.List
- Enclosing class:
- SelectImpl
protected static class SelectImpl.Selects extends java.util.AbstractList
Helper class to track selected columns, with fast contains method. Acts as a list of select ids, with additional methods to manipulate the alias of each selected id.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Selects()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAll(SelectImpl.Selects sels)
Add all aliases from another instance.void
clear()
void
clearPlaceholders()
Clear all placeholders and select AS clauses.boolean
contains(java.lang.Object id)
java.lang.Object
get(int i)
java.lang.Object
getAlias(java.lang.Object id)
Returns the alias of a given id.java.util.List
getAliases(boolean ident, boolean inner)
A list representation of the aliases, in select order, with AS aliases present.int
indexOfAlias(java.lang.Object alias)
Return the index of the given alias.void
insertAlias(int idx, java.lang.Object id, java.lang.Object alias)
Insert an alias before the given index, using negative indexes to count backwards.void
setAlias(int idx, java.lang.Object alias)
Set an alias for a given index.int
setAlias(java.lang.Object id, java.lang.Object alias, boolean ident)
Set an alias for a given id.void
setSelectAs(java.lang.Object id, java.lang.String as)
Set that a given id's alias has an AS value.int
size()
-
Methods inherited from class java.util.AbstractList
add, add, addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
-
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
-
-
-
-
Field Detail
-
_ids
protected java.util.List _ids
-
_idents
protected java.util.List _idents
-
_aliases
protected java.util.Map _aliases
-
_selectAs
protected java.util.Map _selectAs
-
_dict
protected DBDictionary _dict
-
-
Method Detail
-
addAll
public void addAll(SelectImpl.Selects sels)
Add all aliases from another instance.
-
getAlias
public java.lang.Object getAlias(java.lang.Object id)
Returns the alias of a given id.
-
setAlias
public int setAlias(java.lang.Object id, java.lang.Object alias, boolean ident)
Set an alias for a given id.
-
setAlias
public void setAlias(int idx, java.lang.Object alias)
Set an alias for a given index.
-
insertAlias
public void insertAlias(int idx, java.lang.Object id, java.lang.Object alias)
Insert an alias before the given index, using negative indexes to count backwards.
-
indexOfAlias
public int indexOfAlias(java.lang.Object alias)
Return the index of the given alias.
-
getAliases
public java.util.List getAliases(boolean ident, boolean inner)
A list representation of the aliases, in select order, with AS aliases present.
-
setSelectAs
public void setSelectAs(java.lang.Object id, java.lang.String as)
Set that a given id's alias has an AS value.
-
clearPlaceholders
public void clearPlaceholders()
Clear all placeholders and select AS clauses.
-
contains
public boolean contains(java.lang.Object id)
- Specified by:
contains
in interfacejava.util.Collection
- Specified by:
contains
in interfacejava.util.List
- Overrides:
contains
in classjava.util.AbstractCollection
-
get
public java.lang.Object get(int i)
- Specified by:
get
in interfacejava.util.List
- Specified by:
get
in classjava.util.AbstractList
-
size
public int size()
- Specified by:
size
in interfacejava.util.Collection
- Specified by:
size
in interfacejava.util.List
- Specified by:
size
in classjava.util.AbstractCollection
-
clear
public void clear()
- Specified by:
clear
in interfacejava.util.Collection
- Specified by:
clear
in interfacejava.util.List
- Overrides:
clear
in classjava.util.AbstractList
-
-