Java Doc for RowReaderDefaultImpl.java in  » Database-ORM » db-ojb » org » apache » ojb » broker » accesslayer » 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 » db ojb » org.apache.ojb.broker.accesslayer 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.ojb.broker.accesslayer.RowReaderDefaultImpl

All known Subclasses:   org.apache.ojb.broker.RowReaderTestImpl,
RowReaderDefaultImpl
public class RowReaderDefaultImpl implements RowReader(Code)
Default implementation of the RowReader interface.
version:
   $Id: RowReaderDefaultImpl.java,v 1.30.2.11 2005/12/21 22:22:58 tomdz Exp $



Constructor Summary
public  RowReaderDefaultImpl(ClassDescriptor cld)
    

Method Summary
protected  ObjectbuildOrRefreshObject(Map row, ClassDescriptor targetClassDescriptor, Object targetObject)
     Creates an object instance according to clb, and fills its fileds width data provided by row.
protected  StringextractOjbConcreteClass(ClassDescriptor cld, ResultSet rs, Map row)
    
public  ClassDescriptorgetClassDescriptor()
    
public  voidreadObjectArrayFrom(ResultSetAndStatement rs_stmt, Map row)
     materialize a single object, described by cld, from the first row of the ResultSet rs. There are two possible strategies: 1.
public  ObjectreadObjectFrom(Map row)
     materialize a single object, described by cld, from the first row of the ResultSet rs. There are two possible strategies: 1.
public  voidreadPkValuesFrom(ResultSetAndStatement rs_stmt, Map row)
    
protected  voidreadValuesFrom(ResultSetAndStatement rs_stmt, Map row, FieldDescriptor[] fields)
    
public  voidrefreshObject(Object instance, Map row)
    
protected  ClassDescriptorselectClassDescriptor(Map row)
     Check if there is an attribute which tells us which concrete class is to be instantiated.
public  voidsetClassDescriptor(ClassDescriptor cld)
    


Constructor Detail
RowReaderDefaultImpl
public RowReaderDefaultImpl(ClassDescriptor cld)(Code)




Method Detail
buildOrRefreshObject
protected Object buildOrRefreshObject(Map row, ClassDescriptor targetClassDescriptor, Object targetObject)(Code)
Creates an object instance according to clb, and fills its fileds width data provided by row.
Parameters:
  row - A Map contain the Object/Row mapping for the object.
Parameters:
  targetClassDescriptor - If the "ojbConcreteClass" feature was used, the targetorg.apache.ojb.broker.metadata.ClassDescriptor could differ from the descriptorthis class was associated - see RowReaderDefaultImpl.selectClassDescriptor.
Parameters:
  targetObject - If 'null' a new object instance is build, else fields of object willbe refreshed.
throws:
  PersistenceBrokerException - if there ewas an error creating the new object



extractOjbConcreteClass
protected String extractOjbConcreteClass(ClassDescriptor cld, ResultSet rs, Map row)(Code)



getClassDescriptor
public ClassDescriptor getClassDescriptor()(Code)



readObjectArrayFrom
public void readObjectArrayFrom(ResultSetAndStatement rs_stmt, Map row)(Code)
materialize a single object, described by cld, from the first row of the ResultSet rs. There are two possible strategies: 1. The persistent class defines a public constructor with arguments matching the persistent primitive attributes of the class. In this case we build an array args of arguments from rs and call Constructor.newInstance(args) to build an object. 2. The persistent class does not provide such a constructor, but only a public default constructor. In this case we create an empty instance with Class.newInstance(). This empty instance is then filled by calling Field::set(obj,getObject(matchingColumn)) for each attribute. The second strategy needs n calls to Field::set() which are much more expensive than the filling of the args array in the first strategy. client applications should therefore define adequate constructors to benefit from performance gain of the first strategy.
throws:
  PersistenceBrokerException - if there is an error accessing the access layer



readObjectFrom
public Object readObjectFrom(Map row) throws PersistenceBrokerException(Code)
materialize a single object, described by cld, from the first row of the ResultSet rs. There are two possible strategies: 1. The persistent class defines a public constructor with arguments matching the persistent primitive attributes of the class. In this case we build an array args of arguments from rs and call Constructor.newInstance(args) to build an object. 2. The persistent class does not provide such a constructor, but only a public default constructor. In this case we create an empty instance with Class.newInstance(). This empty instance is then filled by calling Field::set(obj,getObject(matchingColumn)) for each attribute. The second strategy needs n calls to Field::set() which are much more expensive than the filling of the args array in the first strategy. client applications should therefore define adequate constructors to benefit from performance gain of the first strategy. MBAIRD: The rowreader is told what type of object to materialize, so we have to trust it is asked for the right type. It is possible someone marked an extent in the repository, but not in java, or vice versa and this could cause problems in what is returned. we *have* to be able to materialize an object from a row that has a objConcreteClass, as we retrieve ALL rows belonging to that table. The objects using the rowReader will make sure they know what they are asking for, so we don't have to make sure a descriptor is assignable from the selectClassDescriptor. This allows us to map both inherited classes and unrelated classes to the same table.



readPkValuesFrom
public void readPkValuesFrom(ResultSetAndStatement rs_stmt, Map row)(Code)



readValuesFrom
protected void readValuesFrom(ResultSetAndStatement rs_stmt, Map row, FieldDescriptor[] fields)(Code)



refreshObject
public void refreshObject(Object instance, Map row)(Code)

See Also:   org.apache.ojb.broker.accesslayer.RowReader.refreshObject(ObjectMap)



selectClassDescriptor
protected ClassDescriptor selectClassDescriptor(Map row) throws PersistenceBrokerException(Code)
Check if there is an attribute which tells us which concrete class is to be instantiated.



setClassDescriptor
public void setClassDescriptor(ClassDescriptor cld)(Code)



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.