entity

ObjectContext disposed puzzle

Hi, I have the follwing method. public List<MyEntity> GetMyEntities(MyObjectContext objCtx) { using(MyObjectContext ctx = objCtx ?? new MyObjectContext()) { retun ctx.MyEntities.ToList(); } } The idea is, user of this method can pass in the objectcontext if they have. If not then a new objectcontext will be c...

Entity Date Modelset Generates Errors in Visual Web Developer

I attempted to add a ADO.NET Entity Data Model to my Visual Web Developer 2010 Express project and it generates but returns a whole slew of errors. Why is this generating errors? Here are the main errors: 'Public Property ID As Integer' has multiple definitions with identical signatures. Method 'Onaddress_IDChanging' cannot be declared ...

How do I get entity for primary key when using EntityDataSource in ASP.NET

I have a GridView in my ASP.NET application that takes data to be rendered from EntityDataSource. GridView allows user to select rows. I want to get the entity that corresponds to the row user selected. I can get from GridView the ID(primary key) of the entity that corresponds to the row selected. How can I get the Entity that has partic...

Entity Relationship Multiple 1:1's

I have an application where I have a generic object (table) called Hull. Each hull in the table is unique. I have another object that has three hulls, but they are specifically the Port_Hull, Center_Hull and Starboard_Hull. Rather than create a One to Many relationship, I was trying to create a one to one relationship for each one,...

flex/actionscript client entity state refresh on JPA update using Pimento EntityManager

My Flex application uses a client-side pimento EntityManager which fetches quite a few objects and associations. It does this by forcing eager fetching of particular association ends in the form of fetch plans. I would like to update the client whenever a change has been made to an entity existing in the EntityManager's cache. Is it poss...

MVVM: where is the best place to integrate an id counter, in ViewModel or Repository or... ?

Hello, I am using http://loungerepo.codeplex.com/ this library needs a unique id when I persist my entities to the repository. I decided for integer not Guid. The question is now where do I retrieve a new integer and how do I do it? This is my current approach in the SchoolclassAdministrationViewModel.cs: public SchoolclassAdminist...

WPF DataGrid Entity Framework: Is it possible to bind a datagrid column to a method/function?

Hi. I'm wondering if it's possible to bind a gridcolumn (field) to a method or function of an entity? For example I have two entities Person and Company that both inherit the abstract entity Addressee. In my grid I'm listing all Addressees (both persons and companies). I have a column, Name, in the datagrid that I whish to bind to a f...

Hibernate is persisting entity during flush when the entity has not changed

I'm having a problem where the entity manger is persisting an entity that I don't think has changed during the flush. I know the following code is the problem because if I comment it out the entity doesn't persist. In this code all I'm doing is loading the entity and calling some getters. Query qry = em.createNamedQuery("Clients.findBy...

Info on Seam's EntityQuery?

I've been working with Seam and JPA/Hibernate for quite some time, but have just started looking at making use of the EntityHome and EntityQuery classes more. EntityHome seems relatively straightforward in terms of what it is and how I can leverage it. But, EntityQuery is a bit less clear. I understand the ability to grab, for example...

entity framework client connection details versus connection details in EF library?

Hi, I have an EF project which has embedded connection details. Then when I use this project from a client library I get told to copy the config file across, which includes the connection details. What are the rules re which connection string would be used here? i.e. does the database connection string in the client project override ...

Type casting problem with java for-each loop

Hi, I have traced an issue with an application I am developing, it is giving me a type cast exception. Funny thing is it is saying it cannot cast "entities.Movie cannot be cast to entities.Movie"?! movies is an ArrayList. try { movies = getMovies(); } catch (Exception e) { e.printStackTrace(System.out); } fi...

getting expat to use .dtd for entity replacement in python

I'm trying to read in an xml file which looks like this <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE dblp SYSTEM "dblp.dtd"> <dblp> <incollection> <author>Jos&eacute; A. Blakeley</author> </incollection> </dblp> The point that creates the problem looks is the Jos&eacute; A. Blakeley part: The parser calls its character han...

How to get all entity kinds from GAE server?

How can I get all entity kinds from GAE server? Is this possible? I want to make a DB manager tool for GAE. ...

Self join in Entity Framework

Hi, I want to have following type of query in entity frame work SELECT c2.* FROM Category c1 INNER JOIN Category c2 ON c1.CategoryID = c2.ParentCategoryID WHERE c1.ParentCategoryID is NULL How to do the above work in Entity framework... ...

ADO.NET Entity Framework with OLE DB SQLServer2000 Data Source

Same as Title. Has anyone found a way to make the ADO.NET Entity Framework work with OLE DB or ODBC data sources? Specifically, I need to work with an SqlServer2000. ...

Entity Framework - Optimistic Concurrency Issue

I have a windows service that runs every 10 seconds ... each time it runs, it takes some test data, modifies it and persists it to the database using the EntityFramework. However, on every second run, when I try to persist the change I get the following Optimistic Concurrency Exception:- Store update, insert, or delete statement affe...

Add the origin connectionString to Linq2Sql entities.

Hi, I have a ASP.NET web application that use the same DataContextType to access several Databases with the same schema. A problem I have is that I'd like to reference the origin Database of entities by adding to them a property (e.g. a ConnectionString property) and auto assign it on entity creation. I though it could be done easily...

Entity Framework conditional mapping operator other than = and is

Is it possible to create an EntitySet with a conditional mapping other than Value or IsNull? Suppose we have have a Product object with a field DateTime Expiration. I want to have ExpiredProducts and ActiveProducts based on Expiration>DateTime.Now so I can query like this: var expired = from p in ExpiredProducts select p; ...

Entity framework : [Set all the entities with internal access specifier]

Hi, By virtue of my application, I need to seperate my business entities from the entities created by EF4. I need to restrict the entities to only access the repository from where they are translated (using translator) to business entities shared at business and service layer. I thought of restricting them by specifying them as internal....

Can ENTITY declarations be nested in referenced XML files?

I'm working on a rather large DocBook XML document. The main book has the chapters but includes all the subsections by reference using entities. Something like this: main.book.xml: <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ <!ENTITY section1 SYSTEM "../fragmen...