entity

How do I use a custom xml entity in a javascript file

I have an 'overlay.dtd' file with a line like <!ENTITY myentity "myvalue">. At the top of my xul file I have <!DOCTYPE overlay SYSTEM 'chrome://myaddon/locale/overlay.dtd'>. In my xul file, I have <script src='myscript.js'>. I want to know if there is any way to access 'myentity' from the script. alert("&myentity;") just alerts "" ...

Silverlight -RIA Services-This EntitySet of type <> does not support the 'Add' operation.

In Silverlight project I have this exception when I tried to Add a new object to a DataGrid when a button is clicked. In the DomainService class.. I know I have to implement the Add operation for the new Entity I'm putting, but how can I do that? I mean I did the class, the get method but how do I do the insert operation, I can't see m...

JPA thinks I'm deleting a detached object

So, 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 (with a bunch of help from the folks here...), 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 loaded and then call the same DAO to dele...

change validate message in data annotation

my object has field with data type int. when i put in html form in this textbox letter not number the validator say- The field must be a number. how can i change this messages like this [Required(ErrorMessage = "Введите название")] [DisplayName("Название")] public int age { get; set; } ...

insert,update, delete derived entity in entity framework 4.0

Hi! How do i insert an entity that is derived from another entity. here is my code but it's not working:(applicationreplacement derived from application public void AddReplacementApp(Application entity,ApplicationReplacement rentity) { _ctx.CreateObjectSet<Application>().AddObject(rentity); _ctx.SaveChanges(); ...

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 some list in the entity can be lazy initialized. I'm wondering what's the correct way to fo...

ADDTOENTITY not available on my context

why is it that i dont have AddToEntity (ex: AddToCustomer) not available on my context..all i have is AddObject..? Thankx. I am using EF 4.0 ...

Sorting the data returned by a database

hi all, In our project we have a requirement that when a set of records are returned by the database the records should be sorted with respect to the TITLE field in the record. The records will have to be sorted alphabetically but if the title of a record has a number in it then it should come after the records whose title only consists...

Entity Relationships - Can a weak entity take part in a 'one to many' relationship as the 'one'

Hi, With the following entity relationship structure I'm struggling to figure out if the relationship between the LOAN and ITEM entities is valid? The weak entity of LOAN uses a partial key of 'loan_dateLeant' and the primary keys from CUSTOMER and ITEM to form LOANs primary key. However LOAN has a 'one to many' relationship with ITEM ...

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. Is there a easier way? Thanks ...

DDD and distinction between Entity and Value object. Choosing the aggregate root

I am design and EMR. I have determined the central object to the domain is the Patient. The patient must have the following a Doctor and Medical Records. Medical Records is a grouping term refering to the collective of Encounters, Labs, XRays, Prescriptions.... I am new to DDD and I am having trouble with a couple of concepts and my...

The specified type member 'EntityKey' is not supported in LINQ to Entities

I have 2 Entities "UserProfile" and "Agent", they are 1-many relationship. I want to do a query to get a list of Agents by giving the userProfileEntityKey. When I run it, I got this "The specified type member 'EntityKey' is not supported in LINQ to Entities" error. public IQueryable<Agent> GetAgentListByUserProfile(EntityKey userProfil...

EntityFramework how to Override properties

I've just started using EF in VS2010. That thing is just amazin'. I frankly can't understand something. For example I have EntityType with property, they generated from database structure. Now, I have to simply override that property in my code. I don't need to save value of the property back into DB, but everytime when it gets read fr...

one-to-one relationship using JPA

I have created two table using JPA. i need to give 1-1 relationship between these tables. Can any one tell me how to give relationship between these tables. ...

Is there a way to add or remove a line of an LINQ to DB Query based on if the value being checked is null?

If I have a query like this: String Category = HttpContext.Current.Request.QueryString["Product"].ToString(); IQueryable<ItemFile> pressReleases = from file in connection.ItemFile where file.Type_ID == 8 && file.Ca...

NHibernate & Cancelling Changes to Entities

Hi, This seems like it would be a common issue to be but I don't know the best way to solve it. I want to be able to send an Entity to a view, have changes be made to the entity in the view, but then cancel (remove) those changes if the user cancels out of the view. What is the proper way to do this. Here are two options I have but I...

Problem creating ObjectContext from different project inside solution.

I have two projects in my Solution. One implements my business logic and has defined entity model of entity framework. When I want to work with classes defined within this project from another project I have some problems in runtime. Actually, the most concerning thing is why I can not instantiate my, so called, TicketEntities(ObjectCont...

What's the difference between entity and class?

Is entity an instance of class? ...

UDF call in entity framework is cached

I am doing a test after reading an article http://blogs.msdn.com/alexj/archive/2009/08/07/tip-30-how-to-use-a-custom-store-function.aspx about udf function called. When I use a function with objectContext.Entities.Where( t=> udf(para1, para2) == 1), here the Entities is not ObjectQuery, but an ObjectSet, the first time I call the method...

JPA - Entity design problem

I am developing a Java Desktop Application and using JPA for persistence. I have a problem mentioned below: I have two entities: Country City Country has the following attribute: CountryName (PK) City has the following attribute: CityName Now as there can be two cities with same name in two different countries, the primaryKe...