J

Sorry I didnt realize you were trying to pass an int.  You just need to
convert the ObjectKey that is being returned to an int value.  Take a
look at the API for details on how to convert it:

http://icu-web.org/turbine-docs/apidocs/overview-summary.html

I think getValue() will return the underlying int value you want.

if you have the cast class exception, re-post I have some other ideas
you could try.  Also when I looked at your previous code snippet, you
were accessing the userid of User as getUserId() but I believe the
column name is user_id which would mean the method should be
getUser_id() instead.

-b

On Mon, 2002-12-16 at 20:58, [EMAIL PROTECTED] wrote:
> 
> No, this reports:
> 
> [javac] appname\WEB-INF\src\java\com\genelogic\appname\modules\
>       actions\MyFormActions.java:62: setAddedBy(int) in com.gen
> elogic.appname.om.BaseSampleSet cannot be applied to
> (org.apache.torque.om.Object
> Key)
> 
>     [javac]             newSet.setAddedBy(( (TurbineUser) data.getUser()
> ).getPrimaryKey());
>     [javac]                   ^
>     [javac] 1 error
> 
> Though I have a feeling even if this did compile it would leave me w/
> another class cast exception (since turbine.om.security.User seems to
> dislike being cast to TurbineUser within my own om).
> -j
> 
> 
> 
>                                                                                      
>                          
>                       Bill                                                           
>                          
>                       <bhalpin@collaborative        To:       Turbine Users List     
>                          
>                       fusion.com>                    
><[EMAIL PROTECTED]>                         
>                                                     cc:                              
>                          
>                       12/16/2002 07:36 AM           Subject:  Re: Access to current 
>user ID?                   
>                       Please respond to                                              
>                          
>                       "Turbine Users List"                                           
>                          
>                                                                                      
>                          
>                                                                                      
>                          
> 
> 
> 
> 
> On Mon, 2002-12-16 at 17:07, [EMAIL PROTECTED] wrote:
> >
> 
> > newA.setAddedBy(data.getUser().getUserId());  <-- doesn't work
> 
> this should work:
> 
>  ( (TurbineUser) data.getUser() ).getPrimaryKey()
> 
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <
> mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <
> mailto:[EMAIL PROTECTED]>
> 
> 
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to