entity « Field « JPA Q&A





1. How to fill entity's field with separate queue in Hibernate?    stackoverflow.com

I have an entity, say

@Entity
public class Category {

  private String name;

  private int usersInCategory;
}
I want to fill usersInCategory field with some aggregating SQL query (select count(*) ... group by ...

2. Updating one field in JPA entity    stackoverflow.com

I have an Entity User that is assigned a system privilege in a function. I have a web page where you select a user from a drop down and ...

3. Hide / remap field values in Hibernate entity based on user permissions    stackoverflow.com

In a Spring 2.6 / JPA 1 / Hibernate 3.3 application I need to "hide" some entity field data based on the current user's permissions. E.g. on an entity "Document" there's ...

4. Make a JPA entity field not to generate table coulmn automatically    stackoverflow.com

In a JPA entity bean I do not write

@Column("bla bla")
before the getter or field declaration, JPA generates a table column for my field.
private boolean myfield;

public Field getMyfield(){
...
}

public void setMyfield(){
...
}
I think it ...

5. Accesing proxied entity instance fields.    forum.hibernate.org

Hello. I have an Entity which is loaded on demand (through proxy) and if I access a instance variable (which is a Embedded type) on the Entity directly not through a getter method the instance field is null (presumably because the field is accessed on the proxy and not on the actual instance). For example: Code: @Embeddable class EmbeddableType { ...

6. Help needed: flush updates all the fields of the entity    forum.hibernate.org

If I update one field of the entity in java code (using the setter), when I do fludh(), hibernate updates all the columns for that entity (even though I did not modify them). (This is a big problem since I have 2 pages that modify different fields of the same entity, that can be accessed concurrently by 2 users.) Is this ...

7. Advice needed on how to NOT update one field of an entity    forum.hibernate.org

I need advice on this simple strategy question: I have a typical User entity which among other fields, has a password. When I update the user object I do not want to update the password because it is encrypted in the database and the user object that I am updating, that has been passed in from the UI, contains the ...