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
878
votes
33 answers

How to fix the Hibernate "object references an unsaved transient instance - save the transient instance before flushing" error

I receive following error when I save the object using Hibernate object references an unsaved transient instance - save the transient instance before flushing
Tushar Ahirrao
  • 12,669
  • 17
  • 64
  • 96
333
votes
24 answers

PersistentObjectException: detached entity passed to persist thrown by JPA and Hibernate

I have a JPA-persisted object model that contains a many-to-one relationship: an Account has many Transactions. A Transaction has one Account. Here's a snippet of the code: @Entity public class Transaction { @Id @GeneratedValue(strategy =…
Paul Sanwald
  • 10,899
  • 6
  • 44
  • 59
238
votes
17 answers

How to update only one field using Entity Framework?

Here's the table Users UserId UserName Password EmailAddress and the code.. public void ChangePassword(int userId, string password){ //code to update the password.. }
h3n
  • 5,142
  • 9
  • 46
  • 76
175
votes
18 answers

How to set a default entity property value with Hibernate

How do I set a default value in Hibernate field?
Dejell
  • 13,947
  • 40
  • 146
  • 229
142
votes
13 answers

How to delete an object by id with entity framework

It seems to me that I have to retrieve an object before I delete it with entity framework like below var customer = context.Customers.First(c => c.Id == 1); context.DeleteObject(customer); context.Savechanges(); So I need to hit database twice.…
Jeff
  • 1,421
  • 2
  • 9
  • 3
134
votes
4 answers

What is the difference between persist() and merge() in JPA and Hibernate?

What is the difference between persist() and merge() in Hibernate? persist() can create a UPDATE & INSERT query, eg: SessionFactory sef = cfg.buildSessionFactory(); Session session = sef.openSession(); A a=new…
Jimit Tank
  • 1,479
  • 5
  • 19
  • 25
129
votes
5 answers

what is difference between a Model and an Entity

I am confused to understand what is the meaning of this words: Entity, Model, DataModel, ViewModel Can any body help me to understanding them please? Thank you all.
amiry jd
  • 27,021
  • 30
  • 116
  • 215
116
votes
11 answers

Improving bulk insert performance in Entity framework

I want to insert 20000 records in a table by entity framework and it takes about 2 min. Is there any way other than using SP to improve its performance. This is my code: foreach (Employees item in sequence) { t = new Employees (); t.Text =…
Vahid Ghadiri
  • 3,966
  • 7
  • 36
  • 45
106
votes
1 answer

cascade={"remove"} VS orphanRemoval=true VS ondelete="CASCADE

I tried to gather some information about the following way to delete automatically child entity when a parent entity is deleted. Seems that the most common way is to use one those three annotation: cascade={"remove"} OR orphanRemoval=true OR…
Alexis_D
  • 1,908
  • 3
  • 16
  • 35
93
votes
4 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
  • 1,121
  • 2
  • 11
  • 14
88
votes
15 answers

EF 4.1 exception "The provider did not return a ProviderManifestToken string"

I am trying to replicate an example found on MSDN. I am using ASP.NET and EF 4.1 (CTP?). I've used NuGet to install the EntityFramework package. I am getting this error: The provider did not return a ProviderManifestToken string ... and the database…
bugnuker
  • 3,918
  • 7
  • 24
  • 31
84
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
  • 57,827
  • 19
  • 139
  • 159
83
votes
5 answers

Entity Framework - Is there a way to automatically eager-load child entities without Include()?

Is there a way to decorate your POCO classes to automatically eager-load child entities without having to use Include() every time you load them? Say I have a Class Car, with Complex-typed Properties for Wheels, Doors, Engine, Bumper, Windows,…
76
votes
9 answers

What's the HTML character entity for the # sign?

What's the HTML character entity for the # sign? I've looked around for "pound" (which keeps returning the currency), and "hash" and "number", but what I try doesn't seem to turn into the right character.
chimerical
  • 5,883
  • 8
  • 31
  • 37
74
votes
7 answers

How can I disable migration in Entity Framework 6.0

I'm trying to ignore the "Automatic" migration using Entity Framework 6.0 rc1. My problem is that I don't want this feature right now and every time that my application runs I can see all entity logs trying to create all tables. Anticipate thanks.
1
2 3
99 100