Default Marker

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Default Marker

nquirynen
Hi,

I'm using the following example for multiple database support with
hibernate:
https://tawus.wordpress.com/2012/03/03/tapestry-hibernate-multiple-databases/

With the use of marker annotations the correct hibernate session manager
is injected. I would like to use this in one of our applications, but
all our other applications use just 1 database. This works, but I'll
have to add the @DefaultFactory marker annotation everywhere in all
these other applications that don't really need multiple database
support, but use the same library. So I was wondering if someone knew
how I could make it so that when no Marker annotation is added, some
configured default is used? This way I would only have to configure it
once in the module class for example.

Anyone got an idea what I have to do to achieve this?

Nathan

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Default Marker

nquirynen
So aside from the hibernate library, my problem is that when using
Marker annotations for "tagging" a service I have to add these
annotations everywhere. It would be nice to be able to define a
"default" when adding no marker annotation. Now you get the error about
the fact that**dependency resolution requires that exactly one service
implements the interface.

Is there any way in Tapestry to define a default when no marker is
applied? Or is there another way to achieve this?

I hope my question is clear enough, else you can let me know and I'll
try to make it clear.

Nathan
****

On 10/08/15 14:15, Nathan Quirynen wrote:

> Hi,
>
> I'm using the following example for multiple database support with
> hibernate:
> https://tawus.wordpress.com/2012/03/03/tapestry-hibernate-multiple-databases/ 
>
>
> With the use of marker annotations the correct hibernate session
> manager is injected. I would like to use this in one of our
> applications, but all our other applications use just 1 database. This
> works, but I'll have to add the @DefaultFactory marker annotation
> everywhere in all these other applications that don't really need
> multiple database support, but use the same library. So I was
> wondering if someone knew how I could make it so that when no Marker
> annotation is added, some configured default is used? This way I would
> only have to configure it once in the module class for example.
>
> Anyone got an idea what I have to do to achieve this?
>
> Nathan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Default Marker

Thiago H de Paula Figueiredo
On Wed, 12 Aug 2015 09:34:39 -0300, Nathan Quirynen  
<[hidden email]> wrote:

> So aside from the hibernate library, my problem is that when using
> Marker annotations for "tagging" a service I have to add these
> annotations everywhere. It would be nice to be able to define a
> "default" when adding no marker annotation. Now you get the error about
> the fact that**dependency resolution requires that exactly one service
> implements the interface.

I was thinking the same another day . . .

> Is there any way in Tapestry to define a default when no marker is
> applied? Or is there another way to achieve this?

As far as I know, there isn't. Jira ticket please? :)

--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Default Marker

nquirynen
I'm not sure how to create one. I made an account, but don't think I
have permissions?

On 12/08/15 19:08, Thiago H de Paula Figueiredo wrote:

> On Wed, 12 Aug 2015 09:34:39 -0300, Nathan Quirynen
> <[hidden email]> wrote:
>
>> So aside from the hibernate library, my problem is that when using
>> Marker annotations for "tagging" a service I have to add these
>> annotations everywhere. It would be nice to be able to define a
>> "default" when adding no marker annotation. Now you get the error about
>> the fact that**dependency resolution requires that exactly one service
>> implements the interface.
>
> I was thinking the same another day . . .
>
>> Is there any way in Tapestry to define a default when no marker is
>> applied? Or is there another way to achieve this?
>
> As far as I know, there isn't. Jira ticket please? :)
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]