Skip to content
Advertisement

I can’t extract data from the table and make a connection with the hibernate orm

I start the server, I can’t fill out the list in any way, the database is connected and working, table work, I can’t extract data from the table and make a connection with the hibernate orm

And if I try to add writes: Caused by: org.hibernate.MappingException: Unknown entity: ru.todolist.javafx.objects.Task

class TaskHibernateImpl

JavaScript

class Task object model

JavaScript

File hibernate.cfg.xml hibernate configuration file

JavaScript

TodoEntity.hbm.xml

JavaScript

table todo work

enter image description here

the todolistFx program itself,see empty

enter image description here

program structure

enter image description here

logs run

JavaScript

Advertisement

Answer

I fill in my ObservableList , list , which I got from the table

as you can see the todolist program has filled up enter image description here

class TaskHibernateImpl in this class, data is taken from the table ,method tasksclear() checking the table clearing so that there is no double table filling, we clear the current one.createQuery(“From Task”) here I attention! specify my class entity

JavaScript

class HibernateSessionFactoryUtil -> In this class, I create a configuration and add a class to it, with a JPA configuration

JavaScript

class Task -> In this class I put JPA annotations @Entity, @Id, @Column

JavaScript

class hibernate.cfg.xml hibernate configuration class

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement