Package net.sf.basedb.core.data
Class ContextData
java.lang.Object
net.sf.basedb.core.data.BasicData
net.sf.basedb.core.data.ContextData
- All Implemented Interfaces:
IdentifiableData
This class holds context information to help client applications
with storing common settings for tables.
- Version:
- 2.0
- Author:
- Nicklas
- See Also:
- Last modified
- $Date: 2024-10-10 14:14:57 +0200 (Thu, 10 Oct 2024) $
- Hibernate: class
- table="`Contexts`" lazy="true"
-
Field Summary
Modifier and TypeFieldDescriptionprivate ClientData
private int
private boolean
private int
private int
static final int
The maximum length of the name that can be stored in the database.static final int
The maximum length of the sort order that can be stored in the database.static final int
The maximum length of the name that can be stored in the database.private String
private int
private Map<String,
PropertyFilterData> private int
private int
private String
private AnnotationTypeCategoryData
private String
private ItemSubtypeData
private UserData
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet the client which uses this context.int
Flags for specifying include options to an entity query.int
Get the current item ID or 0 if no item is current.Get the subtype of items that is associated with this context.int
Get the item type this context is valid for.getName()
Get the name of thisContext
item.int
getPage()
Get the current page number, starting at 0.Get the map that manages property filters in this context.int
Get the number of rows that are displayed on each table page.Get a map for other settings.int
Get the sort direction, 0 = ascending, 1 = descendingGet property name to sort on.Get the annotation type category that is associated with this context.Get the subcontext this context belongs to.getUser()
Get the user that owns this context.boolean
isPublic()
If the settings are public (ie. can be used by anyone) or not.void
setClient
(ClientData client) void
setInclude
(int include) void
setItemId
(int itemId) void
setItemSubtype
(ItemSubtypeData subtype) void
setItemType
(int itemType) void
void
setPage
(int page) (package private) void
setPropertyFilters
(Map<String, PropertyFilterData> propertyFilters) void
setPublic
(boolean isPublic) void
setRowsPerPage
(int rowsPerPage) (package private) void
setSettings
(Map<String, String> settings) void
setSortDirection
(int sortDirection) void
setSortProperty
(String sortProperty) void
setSubCategory
(AnnotationTypeCategoryData subCategory) void
setSubContext
(String subContext) void
Methods inherited from class net.sf.basedb.core.data.BasicData
equals, getId, getVersion, hashCode, setId, setVersion, toString
-
Field Details
-
user
-
client
-
MAX_NAME_LENGTH
public static final int MAX_NAME_LENGTHThe maximum length of the name that can be stored in the database.- See Also:
-
name
-
itemType
private int itemType -
MAX_SUBCONTEXT_LENGTH
public static final int MAX_SUBCONTEXT_LENGTHThe maximum length of the name that can be stored in the database.- See Also:
-
subContext
-
subtype
-
subCategory
-
isPublic
private boolean isPublic -
rowsPerPage
private int rowsPerPage -
itemId
private int itemId -
page
private int page -
MAX_SORTPROPERTY_LENGTH
public static final int MAX_SORTPROPERTY_LENGTHThe maximum length of the sort order that can be stored in the database.- See Also:
-
sortProperty
-
sortDirection
private int sortDirection -
include
private int include -
propertyFilters
-
settings
-
-
Constructor Details
-
ContextData
public ContextData()
-
-
Method Details
-
getUser
Get the user that owns this context.- Hibernate: many-to-one
- column="`user_id`" not-null="true" update="false" outer-join="false" unique-key="Context_uniquecontext"
-
setUser
-
getClient
Get the client which uses this context.- Hibernate: many-to-one
- column="`client_id`" not-null="true" update="false" outer-join="false" unique-key="Context_uniquecontext"
-
setClient
-
getName
Get the name of thisContext
item.- Hibernate: property
- column="`name`" type="string" length="255" not-null="true" update="true" unique-key="Context_uniquecontext"
-
setName
-
getItemType
public int getItemType()Get the item type this context is valid for.- Hibernate: property
- column="`item_type`" type="int" not-null="true" update="false" unique-key="Context_uniquecontext"
-
setItemType
public void setItemType(int itemType) -
getSubContext
Get the subcontext this context belongs to.- Hibernate: property
- column="`subcontext`" type="string" length="255" not-null="true" update="true" unique-key="Context_uniquecontext"
-
setSubContext
-
getItemSubtype
Get the subtype of items that is associated with this context.- Since:
- 3.20
- Hibernate: many-to-one
- column="`subtype_id`" not-null="false" outer-join="false"
-
setItemSubtype
-
getSubCategory
Get the annotation type category that is associated with this context.- Since:
- 3.20
- Hibernate: many-to-one
- column="`subcategory_id`" not-null="false" outer-join="false"
-
setSubCategory
-
isPublic
public boolean isPublic()If the settings are public (ie. can be used by anyone) or not.- Hibernate: property
- column="`is_public`" type="boolean"
-
setPublic
public void setPublic(boolean isPublic) -
getRowsPerPage
public int getRowsPerPage()Get the number of rows that are displayed on each table page.- Hibernate: property
- column="`rows_per_page`" type="int"
-
setRowsPerPage
public void setRowsPerPage(int rowsPerPage) -
getItemId
public int getItemId()Get the current item ID or 0 if no item is current.- Hibernate: property
- column="`item_id`" type="int"
-
setItemId
public void setItemId(int itemId) -
getPage
public int getPage()Get the current page number, starting at 0.- Hibernate: property
- column="`page`" type="int"
-
setPage
public void setPage(int page) -
getSortProperty
Get property name to sort on.- Hibernate: property
- column="`sort_property`" type="string" length="255"
-
setSortProperty
-
getSortDirection
public int getSortDirection()Get the sort direction, 0 = ascending, 1 = descending- Hibernate: property
- column="`sort_direction`" type="int"
-
setSortDirection
public void setSortDirection(int sortDirection) -
getInclude
public int getInclude()Flags for specifying include options to an entity query.- Hibernate: property
- column="`include`" type="int"
-
setInclude
public void setInclude(int include) -
getPropertyFilters
Get the map that manages property filters in this context.- Hibernate: map
- table="`PropertyFilters`" lazy="true"
- Hibernate: collection-key
- column="`context_id`"
- Hibernate: collection-index
- column="`property`" type="string" length="255"
- Hibernate: collection-composite-element
- class="net.sf.basedb.core.data.PropertyFilterData" not-null="true"
-
setPropertyFilters
-
getSettings
Get a map for other settings.- Hibernate: map
- table="`ContextSettings`" lazy="true"
- Hibernate: collection-key
- column="`context_id`"
- Hibernate: collection-index
- column="`name`" type="string" length="255"
- Hibernate: collection-element
- column="`value`" type="text"
-
setSettings
-