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
32
votes
2 answers

Entity Framework 4.1 InverseProperty Attribute and ForeignKey

I will create two references between Employee and Team entities with foreign keys. So I defined two entities as follow public class Employee { public int EmployeeId { get; set; } public string Name { get; set; } …
Ray
  • 4,038
  • 8
  • 36
  • 48
32
votes
9 answers

Entities equals(), hashCode() and toString(). How to correctly implement them?

I'm implementing equals(), hashCode() and toString() of my entities using all the available fields in the bean. I'm getting some Lazy init Exception on the frontend when I try to compare the equality or when I print the obj state. That's because…
spike07
  • 809
  • 2
  • 12
  • 21
32
votes
2 answers

check constraint entity framework

IN EF can I add a check constraint so if my CustomerNotes entity has a boolean "FollowUpRequired" property I force user to enter a valid future date in the "FollowUpDate" property?
CheGuevarasBeret
  • 1,364
  • 2
  • 14
  • 33
32
votes
4 answers

Efficient way of updating list of entities

I am working on a project which allows the user to edit a list of entities. I map these entities to view models and display them with editor fields. When the user presses the submit button, I go through each model and update it like so: foreach (var…
Stefan Bossbaly
  • 6,682
  • 9
  • 53
  • 82
31
votes
13 answers

Could not build ClassFile - ArchiveException

We develop an application with spring, jpa, tomcat, maven, etc. Locally on my developer machine everything works fine but when we deploy the application on a linux server I get the following exception:…
myborobudur
  • 4,385
  • 8
  • 40
  • 61
30
votes
4 answers

.NET Entity Framework - IEnumerable VS. IQueryable

Please see this line of code. This is an invocation of a stored procedure, which returns an ObjectResult. In order to extract the long values I added the Select: dbContext.FindCoursesWithKeywords(keywords).Select(l => l.Value); Based on…
justabuzz
  • 842
  • 1
  • 9
  • 19
29
votes
8 answers

Should Enterprise Java entities be dumb?

In our legacy Java EE application, there are loads of value object (VO) classes which typically contain only getters and setters, maybe equals() and hashCode(). These are (typically) the entities to be saved in persistence storage. (For the record,…
Péter Török
  • 114,404
  • 31
  • 268
  • 329
29
votes
5 answers

What is difference between @Entity and @Embeddable

The difference between @Entity and @Embeddable annotation when each one is added before class declaration? the first create class as an entity, second insert column from another table? the first create class as an table, while second is embedded…
Sanjeev Yadav
  • 2,921
  • 7
  • 24
  • 23
29
votes
3 answers

How to make Entity Framework cache some objects

I'm using Entity Framework. In my database are stored persons and country of their origins. When I'm loading a person object I wan't to know what is the place each person originates. Is there a way to cache list of countries so that there wouldn't…
Eugeniu Torica
  • 7,484
  • 12
  • 47
  • 62
27
votes
1 answer

How to get Id of last persisted entity using JPA

I am looking a smart and easily readable way to get the id of a persisted entity using JPA. The id is an Integer. One could think of the following solutions: Without using GeneratedValue strategy. This requires looking for a free id before…
perissf
  • 15,979
  • 14
  • 80
  • 117
27
votes
2 answers

Instantiating a context in LINQ to Entities

I've seen two different manners that programmers approach when creating an entity context in their code. The first is like such, and you can find it all over the MSDN code examples: public void DoSomething() { using (TaxableEducationEntities…
Jagd
  • 7,169
  • 22
  • 74
  • 107
27
votes
6 answers

How to do recursive load with Entity framework?

I have a tree structure in the DB with TreeNodes table. the table has nodeId, parentId and parameterId. in the EF, The structure is like TreeNode.Children where each child is a TreeNode... I also have a Tree table with contain id,name and…
Avi Harush
  • 989
  • 2
  • 10
  • 15
27
votes
7 answers

Using a view with no primary key with Entity

I just started on a project converting an application from raw ADO.NET and embedded SQL to Entity. I ran in to a problem with one of the views used by the application. The view has no primary key and no column (or combination of columns) that…
Mike B
  • 5,390
  • 2
  • 23
  • 45
26
votes
2 answers

What is the difference between @Immutable and @Entity(mutable=false) when using Hibernate

What is the difference between the two if any? Should one or both be used on an entity?
non sequitor
  • 18,296
  • 9
  • 45
  • 64
26
votes
3 answers

Checking if Entity exists in google app engine datastore.

What is the best/fastest way to check if an Entity exists in a google-app-engine datastore? For now I'm trying to get the entity by key and checking if the get() returns an error. I don't know the process of getting an Entity on the datastore. Is…
Victor
  • 8,309
  • 14
  • 80
  • 129