incubator-graffito-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christophe Lombart (JIRA)" <j...@apache.org>
Subject [jira] Commented: (GRFT-59) Review PersistenceManager methods
Date Mon, 07 Nov 2005 20:39:19 GMT
    [ http://issues.apache.org/jira/browse/GRFT-59?page=comments#action_12356977 ] 

Christophe Lombart commented on GRFT-59:
----------------------------------------

Now the Persistence Manager has the following methods spec :
    public boolean objectExists(String path) throws PersistenceException;

     boolean isPersistent(Class clazz);

    public void insert(Object object) throws PersistenceException;


    public void update(Object object) throws PersistenceException;

    public Object getObject(Class objectClass, String path) throws PersistenceException;

    public Object getObject(Class objectClass, String path, String versionNumber) throws PersistenceException;

    public void remove(String path) throws PersistenceException;

    public void remove(Object object) throws PersistenceException;

    public void remove(Query query) throws PersistenceException;

    public Object getObject(Query query) throws PersistenceException;

    public Collection getObjects(Query query) throws PersistenceException;

    public Iterator getObjectIterator (Query query) throws PersistenceException;


    public void checkout(String path) throws VersionException;

    public void checkin(String path) throws VersionException;

    public void checkin(String path, String[] versionLabels) throws VersionException;

    public String[] getVersionLabels(String path, String versionName) throws VersionException;

    public String[] getAllVersionLabels(String path) throws VersionException;    

    public void addVersionLabel(String path, String versionName, String versionLabel) throws
VersionException;   

    public VersionIterator getAllVersions(String path) throws VersionException;

    public Version getRootVersion(String path) throws VersionException;

    public Version getBaseVersion(String path) throws VersionException;

    public Version getVersion(String path, String versionName) throws VersionException;


    public void save() throws PersistenceException;  

    public void logout() throws PersistenceException;


Insert and update doesn't contain a path argument. Now, each persistent object has to contains
a JCR path attribute. 
eg.

Class Content 
{
    String contentPath;
   ... other attributes ....
   ... getter/setter

}

Than in the xml mapping file, we can have : 

	<class-descriptor className="Content" jcrNodeType="nt:unstructured">
		<field-descriptor fieldName="contentPath" path="true" />
                 ... other field descriptor ... 
	</class-descriptor>

The path field is not required for details object (bean fields).

Before closing this issue, I'm wondering if we will change also the versionning related methods
? 
I think we can keep the path argument in those methods. If we replace it by the object reference,
the persistence manager will always force to load the object when we want to retreive information
on different versions. 

> Review PersistenceManager methods
> ---------------------------------
>
>          Key: GRFT-59
>          URL: http://issues.apache.org/jira/browse/GRFT-59
>      Project: Graffito
>         Type: Improvement
>   Components: JCR-Mapping
>     Versions: 1.0-a1-dev
>     Reporter: Christophe Lombart
>     Assignee: Christophe Lombart

>
> Review method in pm : insert, delete, ...
> The "path" argument can be dropped if we accept to set into the pojo (and of course in
the xml mapping file) the path reference and/or the UUID. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message