Skip to content
Advertisement

Tag: jpa

Select top 1 result using JPA

I need to bring from DB only one single result. How can I do that with JPA? I tried “select t from table t” but didn’t work. Any other ideas? Answer Try like this It should work UPDATE* You can also try like this

autocomplete in vaadin?

I’m new to vaadin. How do I do autocomplete (actually, more like google suggest) on a huge set of data that cannot be loaded in memory, but instead performing a JPA query on every key event. Is it possible to capture key events on a textfield or combobox? Answer You could check out Henrik Paul’s SuperImmediateTextField, which is a Vaadin

Hibernate @ManyToOne references an unknown entity

I am receiving the following Hibernate Exception: @OneToOne or @ManyToOne on Matchup.awayTeam references an unknown entity: Team The simplified Matchup class looks like this: The simplified Team class looks like this: Notes: Both Matchup and Team have subclasses. I’m not sure if this impacts the situation. Both Matchup and Team are listed in my persistence.xml as being included. If I

How to specify SQL comments through JPA annotations?

Is there any way to specify SQL comments through JPA annotations? Comments for tables and columns. Answer Is there any way to specify SQL comments through JPA annotations? Comments for tables and columns. No. If you want to define tables and columns comments, your best option is to do it after the facts in the generated DDL, before executing it

Difference between FetchType LAZY and EAGER in Java Persistence API?

What is the difference between FetchType.LAZY and FetchType.EAGER in Java Persistence API? Answer Sometimes you have two entities and there’s a relationship between them. For example, you might have an entity called University and another entity called Student and a University might have many Students: The University entity might have some basic properties such as id, name, address, etc. as

How to set application name with JPA (EclipseLink)?

hello everybody i am using JPA with EclipseLink and oracle as DB and i need to set the property v$session of jdbc4 it allows to set an identification name to the application for auditing purposes but i had no lucky setting it up….i have been trying through entitiyManager following the example in this page: http://wiki.eclipse.org/Configuring_a_EclipseLink_JPA_Application_(ELUG) it does not show any

What is the “owning side” in an ORM mapping?

What exactly does the owning side mean? What is an explanation with some mapping examples (one to many, one to one, many to one)? The following text is an excerpt from the description of @OneToOne in Java EE 6 documentation. You can see the concept owning side in it. Defines a single-valued association to another entity that has one-to-one multiplicity.

Advertisement