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
72
votes
6 answers

Should I write equals() and hashCode() methods in JPA entities?

I want to check if entity is in a Collection member (@OneToMany or @ManyToMany) of another entity: if (entity2.getEntities1().contains(entity1)) { }
j2j
  • 821
  • 2
  • 9
  • 7
69
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,185
  • 2
  • 37
  • 43
69
votes
5 answers

Symfony2 collection of Entities - how to add/remove association with existing entities?

1. Quick overview 1.1 Goal What I'm trying to achieve is a create/edit user tool. Editable fields are: username (type: text) plainPassword (type: password) email (type: email) groups (type: collection) avoRoles (type: collection) Note: the last…
ioleo
  • 4,697
  • 6
  • 48
  • 60
66
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
  • 2,255
  • 4
  • 25
  • 49
65
votes
9 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,508
  • 1
  • 14
  • 32
62
votes
12 answers

How can I get my database to seed using Entity Framework CodeFirst?

The database is created successfully (as are the tables) but is not seeded. I have spent several hours and read tons of articles but have not been able to get it. Any suggestions? On a side note, is it possible to call the initializer without having…
Alec
  • 1,646
  • 3
  • 19
  • 35
60
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
58
votes
7 answers

What's the difference between entity and class?

Is entity an instance of class?
Steven
  • 24,410
  • 42
  • 108
  • 130
57
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
  • 905
  • 2
  • 9
  • 12
53
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,597
  • 11
  • 47
  • 57
53
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
  • 2,276
  • 4
  • 33
  • 52
48
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
  • 701
  • 1
  • 6
  • 19
48
votes
5 answers

Configure JPA to let PostgreSQL generate the primary key value

So our project use PostgreSQL database and we use JPA for operating the database. We have created the entities from the database with automatic creator in Netbeans 7.1.2. After small changes our primary key values are described…
Atais
  • 10,857
  • 6
  • 71
  • 111
45
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
  • 766
  • 2
  • 8
  • 19
45
votes
5 answers

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

I have this Entity defined:
Falar
  • 519
  • 2
  • 5
  • 10