> PS. Which version of Cayenne are you using?

Cayenne 3.1B1, Tapestry 5.3.6 and tapestry5-cayenne-server 0.5-SNAPSHOT

> PPS. Don't use CayenneService as a DAO for deleting/saving, either.

I don't even know what CayenneService is ;)
For deleting/committing I inject an ObjectContext (with annotation @OCType(...) 
or ObjectContextProvider from tapestry5-cayenne-server


> public class TapestryCayenneService
> {
>     @Inject @Symbol(value="...") ...
> 
>     public Foo newFoo(ObjectContext oc)
>     {
>         Foo foo = oc.newObject(Foo.class);
>         // Set values in foo from injected symbols...
>         return foo;
>     }

I don't actually need the symbol to set database backed values. The setters are 
mostly in the classes auto generated by the CayenneModeler.
I need the value in other get methods, to return a value that would be the 
symbol concatenated with a property of the object.
  
For example: 

public class Foo extends _Foo {
  
@Inject @Symbol(value="...")

  public String getAbsoluteLocalFilepath(String baseDir) {
      
      return baseDir + "/" + getUserId() + "/" + getFilename();
    }
}



My problem ties into another problem: accessing files outside of webapp. 






> The other approach would be to use a servlet filter, which is much
> more complex.  You'd probably have to register a thread local to bind
> your Tapestry symbol values into and then retrieve them inside your
> CayenneDataObject subclasses (Foo, Bar, etc) using a lifecycle
> callback.  I think this approach would be more work and more magic
> (harder to implement and understand/maintain later), but if you would
> like to explore this avenue instead of a Tapestry service, just ask.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to