cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Gentry <mgen...@masslight.net>
Subject Inject Questions
Date Sat, 25 Sep 2010 16:33:04 GMT
I made a few tweaks to the H2 adapter in 3.1 and was wanting to test
them, so I started creating a simple class/project to test it.
Nothing complex, just insert a few records in a trivial table.

It appears you can no longer create a DataContext.  I finally found
the Inject annotation and tried it, but I get a null pointer exception
because things aren't bootstrapped.  Is there a simple way to do this
now that I'm missing?  (I'm still looking through the code.)

Two other comments:

I can see using Inject being messy in my Tapestry 5 applications as I
have to start using the full path to the Inject annotation every time
since T5 provides an Inject annotation, too.

It also appears you can't Inject inside a method, either:

public void updateFoo()
{
  @Inject ObjectContext context;
  ...
}

There are many times in my current codebase (3.0) that I create a
local context.  Is that feature going to be lost now?

Thanks,

mrg

Mime
View raw message