db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Fox (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (TORQUE-147) Database objects should not need to inherit from BaseObject
Date Sat, 30 Jul 2011 20:34:09 GMT

    [ https://issues.apache.org/jira/browse/TORQUE-147?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13073242#comment-13073242
] 

Thomas Fox commented on TORQUE-147:
-----------------------------------

I plan to impelemt this as follows:
- move the isNew and modified flags (incl getters and setters) from BaseObject to the generated
base classes
- move the hashCode and equals methods from BaseObject to the generated base classes
- remove the class BaseObject from the runtime
- make all classes implement the org.apache.torque.om.Persistent interface
This makes all test cases green.

The following methods from BaseObject are not moved currently:
- get/setByName, get/setByPeerName, get/setByPosition: I would not define those as necessary
for persistent objects. Maybe these methods can be moved to a different interface which is
only implemented if the user choses to generate these methods ?
- getTableMap: Nots sure what to do with this method, if this were moved to the persistent
interface it would make the interface rather Torque-specific. Currently it is not needed that
the Persistent interface defines this method, and I'd rather leave this as is.

The following methods are already implemented/overridden:
- the save(...) methods which are defined in persistent are already generated
- the getters/setters for the primary key which are defined in BaseObject are overridden in
the generated classes. However, to retain current catch clauses in the generated classes,
I'd change the throws clauses in persistent from Exception to TorqueException, plus these
methods need also be implemented (throwing UnsupportedOperationExceptions) for tables without
primary key.

> Database objects should not need to inherit from BaseObject
> -----------------------------------------------------------
>
>                 Key: TORQUE-147
>                 URL: https://issues.apache.org/jira/browse/TORQUE-147
>             Project: Torque
>          Issue Type: Improvement
>            Reporter: Thomas Fox
>            Assignee: Thomas Fox
>
> Currently it is an error if database objects do not inherit from BaseObject. This makes
embedding of Torque objects in other frameworks very difficult, because it does not allow
to choose an own parent to inherit from.
> The minimum requirement would be that it is not required any more that database objects
inherit from BaseObject.
> Ideally BaseObject dies and the base objects inherit directly from java.lang.object.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message