com.facetmap.sql
Class SqlResourceFactory

java.lang.Object
  extended by com.facetmap.sql.SqlResourceFactory

public class SqlResourceFactory
extends java.lang.Object

The SqlResource equivalent of a ResourceSpace. In fact, this class is instantiated as a facade on an existing ResourceSpace, translating regular Resource objects into SqlResource objects whose Headings are in a SqlFacetSpace, instead of in the ResourceSpace's underlying FacetSpace.

TODO provide a cache or two for the results of getById()


Nested Class Summary
 class SqlResourceFactory.SqlResourceIterator
           
 
Field Summary
protected  ResourceSpace resourceSpace
           
protected  SqlFacetSpace sqlFacetSpace
           
 
Constructor Summary
SqlResourceFactory(ResourceSpace resourceSpace, SqlFacetSpace sqlFacetSpace)
           
 
Method Summary
 SqlResource createSqlResource(Resource resource)
           
 java.util.Iterator getAll()
           
 SqlResource getById(int id)
           
 int getResourceCount()
           
 ResourceSpace getResourceSpace()
           
 SqlFacetSpace getSqlFacetSpace()
           
 void setResourceSpace(ResourceSpace resourceSpace)
           
 void setSqlFacetSpace(SqlFacetSpace sqlFacetSpace)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resourceSpace

protected ResourceSpace resourceSpace

sqlFacetSpace

protected SqlFacetSpace sqlFacetSpace
Constructor Detail

SqlResourceFactory

public SqlResourceFactory(ResourceSpace resourceSpace,
                          SqlFacetSpace sqlFacetSpace)
Method Detail

getResourceCount

public int getResourceCount()
                     throws InternalException
Throws:
InternalException

getById

public SqlResource getById(int id)
                    throws InternalException
Throws:
InternalException

getAll

public java.util.Iterator getAll()
                          throws InternalException
Throws:
InternalException

createSqlResource

public SqlResource createSqlResource(Resource resource)

getResourceSpace

public ResourceSpace getResourceSpace()

setResourceSpace

public void setResourceSpace(ResourceSpace resourceSpace)

getSqlFacetSpace

public SqlFacetSpace getSqlFacetSpace()

setSqlFacetSpace

public void setSqlFacetSpace(SqlFacetSpace sqlFacetSpace)