Java Doc for Entity.java in  » Database-ORM » Velosurf » velosurf » model » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database ORM » Velosurf » velosurf.model 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   velosurf.model.Entity

Entity
public class Entity (Code)
The Entity class represents an entity in the data model.
author:
   Claude Brisson

Inner Class :class ValidationError implements Comparable<ValidationError>


Constructor Summary
public  Entity(Database db, String name, boolean readOnly, int cachingMethod)
     Constructor reserved for the framework.

Method Summary
public  voidaddAction(Action action)
     Add an action.
public  voidaddAlias(String alias, String column)
     Add a column alias.
public  voidaddAttribute(Attribute attribute)
     Add a new attribute.
public  voidaddColumn(String colName, int sqlType)
     Add a column at the end of the sequential list of named columns.
public  voidaddConstraint(String column, FieldConstraint constraint)
     Add a constraint.
public  voidaddPKColumn(String colName)
     Add a key column to the sequential list of the key columns.
protected  voidclearCache()
     Clear the cache (not used for now).
public  booleandelete(Map<String, Object> values)
     Delete a row based on (key) values.
public  booleandelete(String keyValue)
     Delete a row based on the unique key string value.
public  booleandelete(Number keyValue)
     Delete a row based on the unique key string value.
public  Stringdeobfuscate(Object value)
     De-obfuscate given value.
public  Instancefetch(List<Object> values)
     Fetch an instance from key values stored in a List in natural order.
public  Instancefetch(Map<String, Object> values)
     Fetch an instance from key values stored in a Map.
public  Instancefetch(String keyValue)
     Fetch an instance from its key value as a string.
public  Instancefetch(Number keyValue)
     Fetch an instance from its key value specified as a Number.
public  ObjectfilterID(Long id)
     Obfuscate this id value if needed.
public  ObjectfilterIncomingValue(String column, Object value)
    
public  ExportedKeyfindExportedKey(Entity fkEntity, List<String> fkCols)
     Check for the existence of an exported key with the same columns.
public  ImportedKeyfindImportedKey(Entity pkEntity, List<String> fkCols)
     Check for the existence of an imported key with the same columns.
public  ActiongetAction(String property)
     get an action.
public  AttributegetAttribute(String property)
     Get a named attribute.
public  List<String>getColumns()
     Getter for the list of column names.
public  DatabasegetDB()
     Get the database connection.
public  StringgetFetchQuery()
     Get the SQL query string used to fetch one instance of this query.
public  StringgetName()
     Getter for the name of this entity.
public  List<String>getPKCols()
     Getter for the list of key column names.
public  StringgetTableName()
     Get the name of the mapped table.
public  booleanhasLocalizedColumns()
    
public  booleaninsert(Map<String, Object> values)
     Insert a new row based on values of a map.
public  voidinvalidateInstance(Map<String, Object> instance)
     Invalidate an instance in the cache.
public  booleanisColumn(String name)
    
public  booleanisLocalized(String column)
     Returns whether the given column is obfuscated.
public  booleanisObfuscated(String column)
     Returns whether the given column is obfuscated.
public  booleanisReadOnly()
    
public  InstancenewInstance()
     Create a new realisation of this entity.
public  InstancenewInstance(Map<String, Object> values)
     Build a new instance from a Map object.
public  InstancenewInstance(Map<String, Object> values, boolean useSQLnames)
     Build a new instance from a Map object.
public  Stringobfuscate(Object value)
     Obfuscate given value.
public  RowIteratorquery()
     Issue a query to iterate though all instances of this entity.
public  RowIteratorquery(List refineCriteria, String order)
     Issue a query to iterate thought instances of this entity, with a facultative refining criteria and a facultative order by clause.
public  StringresolveName(String alias)
     Translates an alias to its column name.
public  voidreverseEnginered()
     Used by the framework to notify this entity that its reverse enginering is over.
public  voidsetCachingMethod(int caching)
     Specify the caching method.
public  voidsetInstanceClass(String className)
     Specify a custom class to use when instanciating this entity.
public  voidsetLocalized(List columns)
     Indicates a column as being localized.
public  voidsetObfuscated(List<String> columns)
     Indicates a column as being obfuscated.
public  voidsetReadOnly(boolean readOnly)
     Set this entity to be read-only or read-write.
public  voidsetTableName(String table)
     set the name of the table mapped by this entity.
public  booleanupdate(Map<String, Object> values)
     Update a row based on a set of values that must contain key values.
public  booleanvalidate(Map<String, Object> row)
     Validate a set of values.


Constructor Detail
Entity
public Entity(Database db, String name, boolean readOnly, int cachingMethod)(Code)
Constructor reserved for the framework.
Parameters:
  db - database connection
Parameters:
  name - entity name
Parameters:
  readOnly - access mode (read-write or read-only)
Parameters:
  cachingMethod - caching method to be used




Method Detail
addAction
public void addAction(Action action)(Code)
Add an action.
Parameters:
  action - action



addAlias
public void addAlias(String alias, String column)(Code)
Add a column alias.
Parameters:
  alias - alias
Parameters:
  column - column



addAttribute
public void addAttribute(Attribute attribute)(Code)
Add a new attribute.
Parameters:
  attribute - attribute



addColumn
public void addColumn(String colName, int sqlType)(Code)
Add a column at the end of the sequential list of named columns. Called during the reverse engeenering of the database.
Parameters:
  colName - column name



addConstraint
public void addConstraint(String column, FieldConstraint constraint)(Code)
Add a constraint.
Parameters:
  column - column name
Parameters:
  constraint - constraint



addPKColumn
public void addPKColumn(String colName)(Code)
Add a key column to the sequential list of the key columns. Called during the reverse-engeenering of the database.
Parameters:
  colName - name of the key column



clearCache
protected void clearCache()(Code)
Clear the cache (not used for now).



delete
public boolean delete(Map<String, Object> values) throws SQLException(Code)
Delete a row based on (key) values.
Parameters:
  values - the Map containing the values success indicator



delete
public boolean delete(String keyValue) throws SQLException(Code)
Delete a row based on the unique key string value.
Parameters:
  keyValue - key value success indicator



delete
public boolean delete(Number keyValue) throws SQLException(Code)
Delete a row based on the unique key string value.
Parameters:
  keyValue - key value success indicator



deobfuscate
public String deobfuscate(Object value)(Code)
De-obfuscate given value.
Parameters:
  value - value to de-obfuscate obfuscated value



fetch
public Instance fetch(List<Object> values) throws SQLException(Code)
Fetch an instance from key values stored in a List in natural order.
Parameters:
  values - the List containing the key values the fetched instance



fetch
public Instance fetch(Map<String, Object> values) throws SQLException(Code)
Fetch an instance from key values stored in a Map.
Parameters:
  values - the Map containing the key values the fetched instance



fetch
public Instance fetch(String keyValue) throws SQLException(Code)
Fetch an instance from its key value as a string.
Parameters:
  keyValue - the key the fetched instance



fetch
public Instance fetch(Number keyValue) throws SQLException(Code)
Fetch an instance from its key value specified as a Number.
Parameters:
  keyValue - the key the fetched instance



filterID
public Object filterID(Long id)(Code)
Obfuscate this id value if needed.
Parameters:
  id - id value filtered id value (that is, obfuscated if needed)



filterIncomingValue
public Object filterIncomingValue(String column, Object value)(Code)



findExportedKey
public ExportedKey findExportedKey(Entity fkEntity, List<String> fkCols)(Code)
Check for the existence of an exported key with the same columns.
Parameters:
  fkEntity - foreign key entity
Parameters:
  fkCols - foreign key columns previously defined exported key, if any



findImportedKey
public ImportedKey findImportedKey(Entity pkEntity, List<String> fkCols)(Code)
Check for the existence of an imported key with the same columns.
Parameters:
  pkEntity - primary key entity
Parameters:
  fkCols - foreign key columns previously defined imported key, if any



getAction
public Action getAction(String property)(Code)
get an action.
Parameters:
  property - action name the action



getAttribute
public Attribute getAttribute(String property)(Code)
Get a named attribute.
Parameters:
  property - attribute name the attribute



getColumns
public List<String> getColumns()(Code)
Getter for the list of column names. the list of column names



getDB
public Database getDB()(Code)
Get the database connection. the database connection



getFetchQuery
public String getFetchQuery()(Code)
Get the SQL query string used to fetch one instance of this query. the SLQ query



getName
public String getName()(Code)
Getter for the name of this entity. the name of the entity



getPKCols
public List<String> getPKCols()(Code)
Getter for the list of key column names. the list of key column names



getTableName
public String getTableName()(Code)
Get the name of the mapped table. name of the mapped table



hasLocalizedColumns
public boolean hasLocalizedColumns()(Code)
Does this entity have localized columns?



insert
public boolean insert(Map<String, Object> values) throws SQLException(Code)
Insert a new row based on values of a map.
Parameters:
  values - the Map object containing the values success indicator



invalidateInstance
public void invalidateInstance(Map<String, Object> instance) throws SQLException(Code)
Invalidate an instance in the cache.
Parameters:
  instance - instance
throws:
  SQLException -



isColumn
public boolean isColumn(String name)(Code)



isLocalized
public boolean isLocalized(String column)(Code)
Returns whether the given column is obfuscated.
Parameters:
  column - the name of the column a boolean indicating whether this column is obfuscated



isObfuscated
public boolean isObfuscated(String column)(Code)
Returns whether the given column is obfuscated.
Parameters:
  column - the name of the column a boolean indicating whether this column is obfuscated



isReadOnly
public boolean isReadOnly()(Code)
Is this entity read-only or read-write? whether this entity is read-only or not



newInstance
public Instance newInstance()(Code)
Create a new realisation of this entity. the newly created instance



newInstance
public Instance newInstance(Map<String, Object> values)(Code)
Build a new instance from a Map object.
Parameters:
  values - the Map object containing the values the newly created instance



newInstance
public Instance newInstance(Map<String, Object> values, boolean useSQLnames)(Code)
Build a new instance from a Map object.
Parameters:
  values - the Map object containing the values
Parameters:
  useSQLnames - map keys use SQL column names that must be translated to aliases the newly created instance



obfuscate
public String obfuscate(Object value)(Code)
Obfuscate given value.
Parameters:
  value - value to obfuscate obfuscated value



query
public RowIterator query() throws SQLException(Code)
Issue a query to iterate though all instances of this entity. the resulting RowIterator



query
public RowIterator query(List refineCriteria, String order) throws SQLException(Code)
Issue a query to iterate thought instances of this entity, with a facultative refining criteria and a facultative order by clause.
Parameters:
  refineCriteria - a refining criteria or null to get all instances
Parameters:
  order - an 'order by' clause or null to get instances in theirnatural order the resulting RowIterator



resolveName
public String resolveName(String alias)(Code)
Translates an alias to its column name.
Parameters:
  alias - alias column name



reverseEnginered
public void reverseEnginered()(Code)
Used by the framework to notify this entity that its reverse enginering is over.



setCachingMethod
public void setCachingMethod(int caching)(Code)
Specify the caching method. See Cache for allowed constants.
Parameters:
  caching - Caching method



setInstanceClass
public void setInstanceClass(String className)(Code)
Specify a custom class to use when instanciating this entity.
Parameters:
  className - the java class name



setLocalized
public void setLocalized(List columns)(Code)
Indicates a column as being localized.
Parameters:
  columns - list of localized columns



setObfuscated
public void setObfuscated(List<String> columns)(Code)
Indicates a column as being obfuscated.
Parameters:
  columns - list of obfuscated columns



setReadOnly
public void setReadOnly(boolean readOnly)(Code)
Set this entity to be read-only or read-write.
Parameters:
  readOnly - the mode to switch to : true for read-only, false forread-write



setTableName
public void setTableName(String table)(Code)
set the name of the table mapped by this entity.
Parameters:
  table - the table mapped by this entityread-write



update
public boolean update(Map<String, Object> values) throws SQLException(Code)
Update a row based on a set of values that must contain key values.
Parameters:
  values - the Map object containing the values success indicator



validate
public boolean validate(Map<String, Object> row) throws SQLException(Code)
Validate a set of values.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.