You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Elin <po...@gmail.com> on 2010/11/08 13:06:20 UTC

Tapestry custom component + hibernate

Is it possible to create a component that uses some hibernate entities,
package it into a separated .jar and then import this component into my main
project being able to autocreate this new entities? 

Something like creating my custom component package following this tutorial
http://tapestry.apache.org/tapestry5.1/cookbook/lib.html

Inside that component, create the "entities" package like at any other
tapestry+hibernate project with my custom entities.

Will tapestry load those entities after adding this packaged component into
my project? so if i have the autocreate entities activated on the
hibernate.cfg.xml, those new entities will be added.


What im trying to do is an extensible application, where anyone can create
their own custom components, with the needed entities if this components
need to store their own data into the database, and being able to do this
without having to modify my main application. I just download the component
made by "someone", add it to my main project and i dont have to add the
mapping myself to my app because its included into that component. Hope you
understand what im trying to do. Would it be possible?

I would test myself but im still having troubles with components
packaging... 
-- 
View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-custom-component-hibernate-tp3254963p3254963.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: Tapestry custom component + hibernate

Posted by Elin <po...@gmail.com>.
Problem solved. There was some kind of conflict with a previous version of my
entity... its working now ;)
-- 
View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-custom-component-hibernate-tp3254963p3255809.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: Tapestry custom component + hibernate

Posted by Elin <po...@gmail.com>.
Having problems again. My packaged component is working fine except the
hibernate part.

I have my main app and a custom componet packaged into a jar. This component
has:

com.udc.mylib.entities
com.udc.mylib.pages
com.udc.mylib.services
...


When i load the packaged component, its displayed correctly into my main
application but when it comes into action and hibernate part should work, it
fails giving me an exception:

Unknown entity: com.udc.mylib.entities.Hello

(Obviously my entity is called "Hello" and its into com.udc.mylib.entities
package)



When i try to add the package with 

    public static void
contributeHibernateEntityPackageManager(Configuration<String> configuration)
{
        configuration.add("com.udc.mylib.entities");
    }

i get an error saying:

....Use of the same entity name twice: Hello

so i suppose it was correctly loaded but somehow, it cant be found.

Any advice?

Thx in advance

-- 
View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-custom-component-hibernate-tp3254963p3255669.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: Tapestry custom component + hibernate

Posted by Elin <po...@gmail.com>.
Thx a lot. I will keep investigating now until it works correctly now that i
know its possible.
-- 
View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-custom-component-hibernate-tp3254963p3254992.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: Tapestry custom component + hibernate

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Mon, 08 Nov 2010 10:06:20 -0200, Elin <po...@gmail.com> wrote:

> Is it possible to create a component that uses some hibernate entities,
> package it into a separated .jar and then import this component into my  
> main project being able to autocreate this new entities?

Yes.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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