playframework « Field « JPA Q&A

1. JPA: Indexing by another field of a table referenced by a foreign key

I'm using JPA through the Play Framework, with Mysql. Let's say I have a JQL query as follows:

SELECT p FROM Person p WHERE = 'New York'
The address field is a foreign ...

2. How do I access multiple fields in a JPA query?

I have a JPA query of the form:

SELECT category, count(*) AS c FROM ...
I know that if the query just returns a single column I can do something like:
List<Article> articles = ...

3. play creates tables with the fields sorted alphabetically

I am using a model in Play like this:

package models;

import java.util.*;
import javax.persistence.*;

import play.db.jpa.*;

public class User extends Model {

    public String email;
    public String password;

4. Injecting fields into Java JPA fields

I'm no pro with Java, so I need a little help. I'm using the Play Framework. I have an Entity class which extends GenericModel with fields like the following:

@Column(name = "description")
private String ...

5. How to select only necessary fields in Playframework using JPA

I have played with Play!framework recently and found it’s great, especially model using JPA. It helps to speed up the development process. However, as advised, we should only select necessary fields in ...

6. PlayFramework get field from model select

Since the play documentation on models is terrible I'll ask here. I have the basic code;

public static void Controller() {
        List<Item> item = Item.find("SELECT ...