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

6026 questions
61
votes
5 answers

DDD and MVC: Difference between 'Model' and 'Entity'

I'm seriously confused about the concept of the 'Model' in MVC. Most frameworks that exist today put the Model between the Controller and the database, and the Model almost acts like a database abstraction layer. The concept of 'Fat Model Skinny…
Nathan Loding
  • 3,007
  • 2
  • 33
  • 42
60
votes
4 answers

Differentiating between domain, model, and entity with respect to MVC

Can someone explain these 3 concepts and the differences between them with respect to an MVC framework along with an example. To me these appear almost equivalent, and it seems they are used interchangeably in some articles and not in others.
Martin Konecny
  • 50,691
  • 18
  • 119
  • 145
50
votes
3 answers

JPA, How to use the same class (entity) to map different tables?

I have two tables: Ta and Tb. They have exactly the same table structure but different table names. I try to create one entity class to map the table structures. Some of my common application modules will use this entity class to dynamically query…
John
50
votes
3 answers

Difference between Entity and DTO

What is the difference between a DTO and an Entity? In details these are my questions: What fields should the DTOs have? For example my entity classes are: @Entity public class MyFirstEntity implements Serializable { @Id @GeneratedValue …
Display Name
  • 671
  • 2
  • 7
  • 13
48
votes
8 answers

Disable caching in JPA (eclipselink)

I want to use JPA (eclipselink) to get data from my database. The database is changed by a number of other sources and I therefore want to go back to the database for every find I execute. I have read a number of posts on disabling the cache but…
James
  • 3,397
  • 10
  • 45
  • 57
48
votes
8 answers

How to clone a JPA entity

I have a JPA entity already persisted in the database. I would like to have a copy of it (with a different id), with some fields modified. What is the easiest way to do this? Like: setting it's @Id field to null and persisting it will work? will I…
krisy
  • 1,308
  • 1
  • 13
  • 31
47
votes
7 answers

What's the difference between entity and class?

Is entity an instance of class?
Steven
  • 21,552
  • 40
  • 100
  • 126
46
votes
6 answers

Entity Framework and Multi threading

We are having some trouble designing our multi-threaded Entity Framework driven application and would like some guidance. We are creating entities on different threads, the entities are added to collections which are then data-bound to various WPF…
Martin Richards
  • 775
  • 2
  • 7
  • 12
46
votes
5 answers

nuget retrieving package metadata

An error occurred while retrieving package metadata for 'bootstrap.3.3.5' from source 'nuget.org'. ========== Finished ========== Where the defect wonder Is site nuget.org may crash or whether the problem is local. I am using Visual Basic on…
Sultan
  • 673
  • 1
  • 6
  • 18
45
votes
8 answers

Java entity - why do I need an empty constructor?

This might sound stupid to you, but why do I need to define an empty constructor in my @Entitys? Every tutorial I saw said : every entity needs an empty constructor. But Java always give you a default invisible empty constructor (if you don't…
sliders_alpha
  • 1,830
  • 3
  • 27
  • 46
44
votes
7 answers

XML Entity for "/"?

So I'm writing some XML generating code, and found that the following attribute value was screwing up the XML formatting: "Jim/Bob" So I looked into the XML Entities used as escape sequences and every list I saw did not include one for the forward…
Alpants
  • 739
  • 2
  • 8
  • 19
43
votes
5 answers

SQL JPA - Multiple columns as primary key

If i want severeal Column to make up an ID. SQL example : CONSTRAINT [PK_NAME] PRIMARY KEY ([Column1],[Column2],[Column3]) How can i do that with a Jpa Entity class ? through columndefinition ? just setting the id field as: value = Column1 +…
Anders Pedersen
  • 1,775
  • 2
  • 17
  • 44
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,624
  • 8
  • 35
  • 48
42
votes
5 answers

symfony2 Catchable Fatal Error: Object of class could not be converted to string

I have this Entity defined:
Falar
  • 489
  • 2
  • 5
  • 10
42
votes
21 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
  • 18,509
  • 49
  • 147
  • 268