Hi Malcolm.
Gosh, you are really doing a lot of extending, and the problem could be just
about anywhere. I would suggest setting up some junit test cases and adding
the extensions one-by-one, that is, adding a new extension only after the
previous extension passes the test. When you get to specific problem that
you can't figure out, we will be much more likely to lead you in the right
direction.
Also, it is a good practice to write Services to wrap your OM layer instead
of repeatedly using the Peers. In this case, Turbine already provides a
service, the TurbineSecurity Service:
TurbineUserAdapter user =
(TurbineUserAdapter)TurbineSecurity.get("username");
assertEquals("Name","name",user.getFirstName());
assertEquals("EoId","1",user.getEoId());
Good luck,
Chris
> -----Original Message-----
> From: malcolm cooke [mailto:[EMAIL PROTECTED]]
> Sent: Monday, November 18, 2002 5:05 AM
> To: Turbine Users List
> Subject: Problems extending user as per how to (and previous messages)
>
>
> Hi,
> I am Using tdk 2.1.and trying to extend turbine_user as per the
> how to and
> have made patches to Object.vm as described in previous threads on this
> subject. I am a newbie as far as turbine is concerned and any
> help would be
> appreciated.
>
> I have extended turbine user as per the how to i.e
> <table name="TURBINE_USER" idMethod="idbroker">
> <column name="USER_ID" required="true"
> primaryKey="true" type="INTEGER"/>
> <column name="EO_ID" required="true" type="INTEGER"/>
> <column name="ST_ID" required="true" type="INTEGER"/>
> <column name="LOGIN_NAME" required="true" size="32"
> type="VARCHAR"/>
> <column name="PASSWORD_VALUE" required="true"
> size="32" type="VARCHAR"/>
> <column name="FIRST_NAME" required="true" size="99"
> type="VARCHAR"/>
> <column name="LAST_NAME" required="true" size="99"
> type="VARCHAR"/>
> <column name="EMAIL" size="99" type="VARCHAR"/>
> <column name="CONFIRM_VALUE" size="99" type="VARCHAR"/>
> <column name="MODIFIED" type="TIMESTAMP"/>
> <column name="CREATED" type="TIMESTAMP"/>
> <column name="LAST_LOGIN" type="TIMESTAMP"/>
> <column name="NOTES" size="255" type="VARCHAR"/>
> <column name="OBJECTDATA" type="VARBINARY"/>
> <unique>
> <unique-column name="LOGIN_NAME"/>
> </unique>
> <foreign-key foreignTable="ORGANISATION">
> <reference local="EO_ID" foreign="O_ID"/>
> </foreign-key>
> <foreign-key foreignTable="STATUS">
> <reference local="ST_ID" foreign="ST_ID"/>
> </foreign-key>
> </table>
>
> with amongst other things two foreign keys. My Agent table
> definition is as
> follows:
> <table name="AGENT" javaName="Agent" alias="TurbineUser"
> baseClass="com.testthingy.test.om.TurbineUserAdapter"
> basePeer="com.testthingy.test.om.TurbineUserPeerAdapter">
> <column name="USER_ID" primaryKey="true"
> autoIncrement="true"
> required="true" type="INTEGER"/>
> </table>
>
> I have created the TurbineUserAdapter with the following methods :
>
> public void setEoId(NumberKey org) {
> setPerm(EO_ID, org);
> }
>
> public NumberKey getEoId() {
> NumberKey tmp = null;
> try {
> tmp = (NumberKey) getPerm(EO_ID);
> }
> catch ( Exception e )
> {
> }
> return tmp;
> }
>
> and TurbineUserAdapterPeer with
> public static final String EO_ID = mapBuilder.getUser_EoId(); in it.
>
> TurbineMapBuilderAdapter has the following:
>
> public static String getEoId() {
> return "EO_ID";
> }
>
> public String getUser_EoId() {
> return getTableUser() + '.' + getEoId();
> }
>
>
> THE PROBLEM:
> When I try to access the EO_ID column via the agent i.e
> NumberKey numkey = new NumberKey("0");
>
> tester = AgentPeer.retrieveByPK(numkey);
> System.out.println("pk = " + tester.getUserId());
> System.out.println("name = " + tester.getFirstName());
> System.out.println("eoid = " + tester.getEoId());
>
> I get the User Id and the First name correctly , but it always
> returns null
> for getEoId(). Where am I going wrong?
>
> thanks
>
> Malcolm
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>