|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.wewebu.ow.server.util.OwStandardDBAttributeBagWriteableFactory
public class OwStandardDBAttributeBagWriteableFactory
Implements a factory for DB based writable attribute bags.
Retrieve a writable attribute bag with getBag(Name).
The factory has the advantage that all attribute bag data is loaded in one single SQL Query.
Uses the following attribute scheme to access the database e.g.:
(Number) | User (String) | Name (String) | AttributeName (String) | AttributeValue (String) |
1 | OW_SITE_USER | ViewerSize | X | 100 |
2 | OW_SITE_USER | ViewerSize | Y | 100 |
3 | UserName | SelectedClass | Account | 1 |
4 | UserName | SelectedClass | Credit | 1 |
5 | UserName | SelectedClass | Depot | 1 |
Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.
For licensing information read the license.txt file or
go to: http://wiki.alfresco.com
Field Summary | |
---|---|
static String |
ATTRIBUTE_ATTR_NAME
DB attribute name of the attribute name |
static String |
ATTRIBUTE_ATTR_VALUE
DB attribute name of the attribute value |
static String |
ATTRIBUTE_BAGNAME
DB attribute name of the Name |
static String |
ATTRIBUTE_INDEX
DB attribute name of the User |
static String |
ATTRIBUTE_USER
DB attribute name of the User |
static int |
LENGTH_LIMIT_ATTRIBUTE_NAME
length limitation for the attribute name |
static int |
LENGTH_LIMIT_ATTRIBUTE_VALUE
length limitation for the attribute value |
static int |
LENGTH_LIMIT_BAG_NAME
length limitation for the bag name |
static String |
SEQUENCE_NAME
name of the oracle sequence |
Constructor Summary | |
---|---|
OwStandardDBAttributeBagWriteableFactory(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate_p,
String strUser_p,
String strTable_p)
constructs the attribute bag with the given Database Use the following attribute scheme: [Index, User, Name, AttributeName, AttributeValue] |
Method Summary | |
---|---|
int |
attributecount(String strBagName_p)
|
void |
clear(String strBagName_p)
|
protected com.wewebu.ow.server.util.OwStandardDBAttributeBagWriteableFactory.OwPreparedStatementCreator |
createStatementCreator()
Create a class which is responsible for prepared statement creation, and also OwAttribute based SQL creation. |
Object |
getAttribute(int iIndex_p,
String strBagName_p)
|
Object |
getAttribute(String strName_p,
String strBagName_p)
|
Collection |
getAttributeNames(String strBagName_p)
|
OwAttributeBagWriteable |
getBag(String sBagName_p)
get a specific attribute bag |
Object |
getSafeAttribute(String strName_p,
Object default_p,
String strBagName_p)
get the attribute with the given name, returns default if not found. |
boolean |
hasAttribute(String strName_p,
String strBagName_p)
|
void |
init()
Load the tuples from the DB, transform them into a local objects representation and cache them. |
protected void |
initColumnLimit()
(overridable) Initializing the limit of the columns, which will be used later before writing to data base. |
void |
remove(String strName_p,
String strBagName_p)
|
void |
save(String strBagName_p)
|
void |
setAttribute(String strName_p,
Object value_p,
String sBagName_p)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String ATTRIBUTE_INDEX
public static final String ATTRIBUTE_USER
public static final String ATTRIBUTE_BAGNAME
public static final String ATTRIBUTE_ATTR_NAME
public static final String ATTRIBUTE_ATTR_VALUE
public static final String SEQUENCE_NAME
public static final int LENGTH_LIMIT_ATTRIBUTE_NAME
public static final int LENGTH_LIMIT_BAG_NAME
public static final int LENGTH_LIMIT_ATTRIBUTE_VALUE
Constructor Detail |
---|
public OwStandardDBAttributeBagWriteableFactory(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate_p, String strUser_p, String strTable_p) throws OwDataSourceException
jdbcTemplate_p
- The Spring JdbcTemplate to use for the database connectivity.strUser_p
- String optional user name to map the attribute bag to a specific user, can be null.strTable_p
- String table name
OwDataSourceException
Method Detail |
---|
public void init() throws Exception
Exception
- if cannot retrieve information from DBprotected void initColumnLimit() throws SQLException
SQLException
public void setAttribute(String strName_p, Object value_p, String sBagName_p) throws Exception
Exception
public void save(String strBagName_p) throws Exception
Exception
public Object getAttribute(int iIndex_p, String strBagName_p) throws Exception
Exception
public Object getAttribute(String strName_p, String strBagName_p) throws Exception
Exception
public Object getSafeAttribute(String strName_p, Object default_p, String strBagName_p)
public boolean hasAttribute(String strName_p, String strBagName_p)
public int attributecount(String strBagName_p)
public Collection getAttributeNames(String strBagName_p)
public OwAttributeBagWriteable getBag(String sBagName_p) throws Exception
sBagName_p
- String name that identifies the attribute bag
Exception
public void clear(String strBagName_p)
public void remove(String strName_p, String strBagName_p)
protected com.wewebu.ow.server.util.OwStandardDBAttributeBagWriteableFactory.OwPreparedStatementCreator createStatementCreator()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |