I would like to load House object which has many-to-one field type:
@ManyToOne(fetch=FetchType.EAGER)
@JoinColumn(name="type_id")
public Type getType() {
return type;
}
I would like now to gain access to it like so:
House temp = DataBaseConnector.getInstance().findHouseByID(id);
Type type = temp.getType();
findHouseById()
method looks like this:
public static House findHouseByID(Integer id) {
Session session = getSessionFactory().openSession();
House e = (House) session.load(House.class, id);
session.close();
return e;
}
But there I got an error:
Exception in thread "AWT-EventQueue-0" org.hibernate.LazyInitializationException: could not initialize proxy - no Session at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:165) at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:286) at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:185) at mapping.House_$$_jvst2a0_3.getType(House_$$_jvst2a0_3.java)
Any help would be appreciated :)
Firebase Cloud Functions: PubSub, "res.on is not a function"
TypeError: Cannot read properties of undefined (reading 'createMessageComponentCollector')
I need to create a database of shopify orders so I can run advanced queries and sales reports that you can't do in the shopify admin areaI'm building in Sails
I have table called t1 with id field and name field
So, I'm trying to build and app in androidstudio and I want to retrieve some data from a mysql database and use this in the appI use a php script online and a responselistener to retrieve the data
I am completely new to SQLI asked that question 2 weeks ago but got no reply, so I am afraid I have to ask again