Questions tagged [entity]

In computer science an entity is an object which has an identity and can be uniquely determined, holds storable information or can be processed. As the term has a very abstract and general meaning prefer to use this tag only in conjunction with other more specific tags.

In computer science an entity is an object which has an identity and can be uniquely determined, holds storable information or can be processed. The term does not apply to a specific technology but has a more abstract meaning.

An entity is one building block in an entity-relationship model (ERM) to describe how data are modeled in an information system.

Often used specific meanings for "Entity" on Stack Overflow

  • A class or instance of a class which is mapped to a relational database by Microsoft's Entity Framework
  • A data object in Apple's iOS Core Data Framework

Links

6421 questions
45
votes
23 answers

org.hibernate.MappingException: Unknown entity: annotations.Users

Consider the hierarchy : And the following classes and xml : HibernateUtil.java package annotations; import org.hibernate.SessionFactory; import org.hibernate.cfg.Configuration; import org.hibernate.service.ServiceRegistry; import…
JAN
  • 21,236
  • 66
  • 181
  • 318
44
votes
8 answers

org.postgresql.util.PSQLException: ERROR: column user0_.id does not exist - Hibernate

I have a model class that is mapped to a postgres database using hibernate. My model class is: @Entity @Table(name="USER") public class User { @Id @GeneratedValue @Column(name="id") private long id; @Column(name="username",…
kovac
  • 4,945
  • 9
  • 47
  • 90
44
votes
3 answers

JPA entity id - primitive or object type (long or Long)

Should the ID of your Entity be long (primitive type) or Long (object type)? The ID is the primary key of my table and is never 'null' in the database. My co-workers suggest to use an Object Type Long. Hibernate Reverse Engineering tool generates a…
Dimitri Dewaele
  • 10,311
  • 21
  • 80
  • 127
43
votes
3 answers

What is the exact meaning of the JPA @Entity annotation?

I am studying JPA in Spring application and I have some doubts related to the @Entity annotation. So I have a model class like this: @Entity @Table(name= “T_CUSTOMER”) public class Customer { @Id @Column(name=“cust_id”) private Long…
AndreaNobili
  • 40,955
  • 107
  • 324
  • 596
43
votes
7 answers

JPA thinks I'm deleting a detached object

I've got a DAO that I used to load and save my domain objects using JPA. I finally managed to get the transaction stuff working, now I've got another issue. In my test case, I call my DAO to load a domain object with a given id, check that it got…
Steve
  • 2,678
  • 8
  • 40
  • 54
40
votes
1 answer

How to access the entity inside the buildForm method of a form

I'm trying to get the entity inside the own form. I lazy remember a getData() method, but it doesn't exist inside the form, and I can't remember how to use it. Is there any way to get the entity inside the buildform method not using an event…
Angel
  • 1,970
  • 4
  • 21
  • 30
39
votes
9 answers

Generate JPA 2 Entities from existing Database

How can I generate JPA2 compliant @Entity from existing Databases?. I found this: Question Still its not clear if JBoss will generate compliant JPA2 and also I would like to know if there is a vendor independent way to do this.
will824
  • 2,203
  • 4
  • 27
  • 29
39
votes
6 answers

XML parser error: entity not defined

I have searched stackoverflow on this problem and did find a few topics, but I feel like there isn't really a solid answer for me on this. I have a form that users submit and the field's value is stored in a XML file. The XML is set to be encoded…
NightHawk
  • 3,633
  • 8
  • 37
  • 56
38
votes
8 answers

JPA 2.0: Adding entity classes to PersistenceUnit *from different jar* automatically

I have a maven-built CDI-based Java SE app, which has a core module, and other modules. Core has the persistence.xml and some entities. Modules have additional entities. How can I add the entities to the spotlight of the persistence unit? I have…
Ondra Žižka
  • 43,948
  • 41
  • 217
  • 277
38
votes
5 answers

How to retrieve mapping table name for an entity in JPA at runtime?

Is it possible to determine the native table name of an entity? If a Table annotation is present it's easy: entityClass.getAnnotation(Table.class).name() But what about if no Table annotation is present? Hibernate provides this information via the…
marabol
  • 1,247
  • 2
  • 15
  • 22
38
votes
4 answers

What are the HTML entities for up and down triangles?

I've found the outlined versions, but I want the solid up and down triangles. Does anyone know these entities?
alex
  • 479,566
  • 201
  • 878
  • 984
38
votes
3 answers

Symfony 2.0 getting service inside entity

Im seraching over and cannot find answer. I have database role model in my application. User can have a role but this role must be stored into database. But then user needs to have default role added from database. So i created a…
Kaminari
  • 1,387
  • 3
  • 17
  • 32
37
votes
1 answer

Symfony2: get the id of the persisted object

I have two entity: User and Person. In the entity User I need the id of the associated person: user_id. When I am creating a new user, I have to create first the person and then the user. In the user, I have to put the id of the corresponding person…
Milos Cuculovic
  • 19,631
  • 51
  • 159
  • 265
36
votes
5 answers

The type 'Company.Model.User' and the type 'Company.Core.Model.User' both have the same simple name of 'User' and so cannot be used in the same model

I have a base entity class MyCompany.Core.Model.User which is to be used for common properties of a User entity: public class User { public string Username { get; set; } public string Usercode { get; set; } } I also have a base mapping…
35
votes
3 answers

Detached Entity and Managed Entity

What a "detached entity" means? How is it possible to convert a managed entity to a detached entity during a transaction?
Shemil
  • 387
  • 1
  • 7
  • 12