[Solved] Using relationships like @OneToMany, @ManyToOne in hibernate is good practice or not? [closed]

Regardless of good practice, the point here is you have two options to model this: Elect to manually assign the Department‘s Id on the Employee. Associate the new Employee with an existing Department entity at save. Which you pick really depends on a number of factors. Often the former is chosen when working with legacy … Read more

[Solved] How To configure Hibernate as a JPA provider for Payara/Glassfish 4.1? [closed]

Found the answer in this article : Hibernate 5 in Payara Briefly, add Hibernate dependencies in your pom.xml, replace payara/glassfish jboss-logging.jar /lib with latest and then restart server. Your project should have in the persistence.xml its provider org.hibernate.jpa.HibernatePersistenceProvider and property name=”hibernate.transaction.jta.platform” value=”org.hibernate.service.jta.platform.internal.SunOneJtaPlatform” solved How To configure Hibernate as a JPA provider for Payara/Glassfish 4.1? [closed]

[Solved] How to increase performance in Spring MVC – Hibernate – JSP – AngularJS v1.6? [closed]

Without more detail, I can only offer general advice, but here goes: Start by profiling the application to see where the bottlenecks actually are. See this question for a list of profiling tools. The golden rule is to measure first, then optimise only what needs optimising! Once you know where improvements need to be made, … Read more

[Solved] Advantage of using JPA [closed]

If you want do decrease the degree of coupling to a certain orm tool, then jpa is a good choice. It defines a set of well defined apis that you may use with any existing persistence provider. Some projects require a specific persistence provider. Hence the jpa allows you to apply (not only) the basic … Read more

[Solved] HQL Order by query giving problem

I solved it using “order by col_1_0_” in above query.. because hibernate creates column with names col_0_0_, col_1_0_, col_2_0_ and so on.. so if you just need to know the order of your column and add it to order by accordingly.. Thanks. amar4kintu 1 solved HQL Order by query giving problem

[Solved] Why the mapping.xml and configuration.xml has to be outside the pojo package?

I have just started to learn the Hibernate and found this in various online sites : mapping.xml and config.xml has to be defined outside the pojo package? You can put xml configurations whenever you want. For an example SessionFactory factory = new Configuration().configure().buildsessionFactory(); Configure a session factory from the default hibernate.cfg.xml. It is the same … Read more

[Solved] could not resolve property 3 [closed]

The problem with an alias com in HQL. com.company.location.entities.Compte has an incorrect meaning with this alias. select com from Compte com where com.statuts=”actif” and com.user=””+user+”” and com.pwd='”+pwd+”‘ ” + “and com.personnels.id in (select p.id from Personnels p where statuts=”actif” Just change it to compte select compte from Compte compte where compte.statuts=”actif” … And, please, use … Read more