a question about how to encapslute @SpringRepository

6 views
Skip to first unread message

jokoul webster

unread,
Dec 5, 2009, 10:45:14 AM12/5/09
to jEmbedded Discussion Group
Hi :
In InvoiceService.java within invoices service example,there are
two annotation code lines

=================================================================================
@SpringRepository(configurationFile = "META-INF/invoices-service/
embedded-database-service/persistence-layer.xml")

@Repository(id="invoicesService", resources={EmbeddedDatabase.class,
MockDataGenerator.class,JdbcServiceImpl.class},
iocProviders = {"springRepository"})

=================================================================================
but you know every business service will need to add above code,and it
will be ugly,so do you have any idea to encapslute them into another
common service,of course I have tried many times but failed to run it
successfully.

Adolfo Estevez

unread,
Dec 6, 2009, 8:03:33 AM12/6/09
to jEmbedded Discussion Group
Hi,

I need you to elaborate a bit more your question but uou don't need to
add the annotation code to every business service, just to the
@Repository, being available the Spring Context that way to all the
added resources (EmbeddedDatabase etc...).

Take care

Adolfo



On Dec 5, 3:45 pm, jokoul webster <jokoulwebs...@gmail.com> wrote:
> Hi :
>    In InvoiceService.java within invoices service example,there are
> two annotation code lines
>
> ===========================================================================­======
> @SpringRepository(configurationFile = "META-INF/invoices-service/
> embedded-database-service/persistence-layer.xml")
>
> @Repository(id="invoicesService",  resources={EmbeddedDatabase.class,
> MockDataGenerator.class,JdbcServiceImpl.class},
>                 iocProviders = {"springRepository"})
>
> ===========================================================================­======
Reply all
Reply to author
Forward
0 new messages