org.objectweb.jorm.mapper.rdb.lib
Interface RdbPPolymorphicClass


public interface RdbPPolymorphicClass

This interface is supposed to be implemented by (generated) polymorphic classes. It permits to append the filter expession at runtime when creating the queries representing full-extents of polymorphic classes. Filters are defined on a statement basis: a query can be defined as an union of select/from/where statements, each may having filters to be added. Thus statements are named so that we can add the correct filtering expression to the right statement.


Method Summary
 void appendExtentFilters(java.lang.String stmtName, java.lang.StringBuffer sb)
          This method is called when creating queries.
 java.lang.String getExtentQuery(boolean withPrefetch)
          Returns the query computed in the pcm.
 java.lang.String getPNameFields()
          Returns the primary key of the class as a String of type "x1, x2" where x1 and x2 compose the primary key.
 

Method Detail

appendExtentFilters

public void appendExtentFilters(java.lang.String stmtName,
                                java.lang.StringBuffer sb)
This method is called when creating queries. It append the filtering expression corresponding to a statement of the query representing the full-extent of the (polymorphic) (generated) class The name of the statement to which the filtering expression is to be added is specified by the given name, so that the right filtering expression is added. The string buffer given in parameter should already contain an SQL expression of the form: 'select ... from ... where' or 'select ... from ... where ... and'

Parameters:
stmtName - the name of the statement in the query definition
sb - the string buffer to which adding the filtering expression.

getPNameFields

public java.lang.String getPNameFields()
Returns the primary key of the class as a String of type "x1, x2" where x1 and x2 compose the primary key.

Returns:

getExtentQuery

public java.lang.String getExtentQuery(boolean withPrefetch)
                                throws PException
Returns the query computed in the pcm. If withPrefetch is true, returns the prefetchExtentQuery else, returns extentQuery.

Throws:
PException