Thanks Vit,

I've defined the hibernate.cfg.xml file

I've defined the following globally in the Application class
private Configuration config = new Configuration();
private ServiceRegistry serviceRegistry;
private SessionFactory sessionFactory;

I've placed the following at the end of the init function
config.configure("hibernate.cfg.xml");
config.setProperty("hibernate.current_session_context_class", "managed");
serviceRegistry = new StandardServiceRegistryBuilder().applySettings(config.getProperties()).build();
sessionFactory = config.buildSessionFactory(serviceRegistry);

But I'm not sure where to put the following parts
Session sess = sessionFactory.openSession();
ManagedSessionContext.bind(sess);

unbindSessionFactory


Thank you for the help so far both of you, I've probably made mistakes with implement parts
of the previously outlined process.
I've come from experimenting with javafx so wicket has been a radical change of direction for me so far. But since there is very little in the way of examples for database integration I'm struggling to get my head around how to implement it correctly, as well as knowing for sure whether I've
done it correctly

Best Regards
James Pollard
james.poll...@iinet.net.au

On 23/12/22 10:16 am, Ernesto Reinaldo Barreiro wrote:
Hi James,

On Thu, Dec 22, 2022 at 2:24 PM James <james.poll...@iinet.net.au> wrote:

Thanks for the guidance so far, that pointed me to find additional
resources on JPA
I believe I have this configured correctly, but I'm confused about how
to integrate JPA/Hibernate into a
pure wicket authenticated web application project since the resource you
directed me to previously
seems to be more heavily on the spring side of things.

This is true. I have used Hibernate/JPA without the SpringBoot parts... But
those projects are private: some owned by me, others no.


Thank you for accommodating all my questions and misunderstandings so
far, I tend to use a reverse
engineer learning style so it's helped me immensely.

Glad to be of some help. This is why this place is for.

I've included screenshots of the project file list and the application
class in the hopes that it makes

They didn't


understanding what I'm trying to convey easier

Best Regards
James Pollard
james.poll...@iinet.net.au

On 20/12/22 12:58 pm, Ernesto Reinaldo Barreiro wrote:
https://github.com/MarcGiffing/wicket-spring-boot/blob/master/wicket-spring-boot-starter-example/src/main/java/com/giffing/wicket/spring/boot/example/model/Customer.java
This defines a JPA entity.... and this JPA/Hibernate


https://github.com/MarcGiffing/wicket-spring-boot/blob/master/wicket-spring-boot-starter-example/src/main/resources/application.yml
Project uses Spring magic I guess and will start a Hibernate with H2.
Wicket is also started via SpringBoot.


On Tue, Dec 20, 2022 at 7:44 AM James <james.poll...@iinet.net.au>
wrote:
I've had a look through it but couldn't find any reference to hibernate
so far, its entirely
possible that I managed to miss it while I was searching though

Best Regards
James Pollard
james.poll...@iinet.net.au

On 19/12/22 5:06 pm, Ernesto Reinaldo Barreiro wrote:
Hi,

This project

https://github.com/MarcGiffing/wicket-spring-boot

contains a sample project that integrates with JPA/hibernate.


On Mon, Dec 19, 2022 at 9:12 AM James <james.poll...@iinet.net.au>
wrote:
Hi,
can anyone direct me to any resources on how to integrate hibernate
for
data persistence?

the closest I've managed to find is


https://www.infoworld.com/article/2077901/web-development-with-wicket--part-3--many-ways-to-persist.html?page=7
but there's still things that are confusing me on how to ingrate an
authenticated application with hibernate

--
Best Regards
James Pollard
james.poll...@iinet.net.au


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


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



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




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

Reply via email to