entity

How do get reference to a related parent object when selecting a list of child objects using entity framework

Using EF how do i access values in a parent property when accessing a list of child objects. i.e. I have a Project object and Timesheet object Project Id Name ... TimeSheet ProjectId UserId Date TimeSpent ... I understand how to get back a Project and its related Timesheets but what if I want to get back all of the timesheets for a ...

Security Exception using MySql and Entity Framework on godaddy

Hello, we are getting a SecurityException when using Entity framework on godaddy. The entity has been configured against a MySql store. (v. 6.1.2) A bit of wierdness with the exception though... Looking at the exception stack it seems to imply that if we open up a connection to MySql anywhere in the site, then we should get the same...

How to save an entity without saving an associated entity used as a lookup for a WinForms combobox

When I try to save a new Order, the entity framework (.NET Framework 3.5 SP1) attempts to insert a new Status row into the database in addition inserting to a new Order row. I do not want to insert a new status row. I only want to insert an Order row to the database. I have the following tables (and columns) with 1-1 entity mappings: ...

Data reader is incompatible... member does not have corresponding column in data reader.

Using VS 2008, SQL Server 2008 and WPF 3.5, I've made some changes to my schema and updated the model. It compiles and runs fine, until the client app calls for a specific entity and I get the following (actual names replaced): The data reader is incompatible with the specified '<Model>.<ViewBasedEntity>'. A member of the type, '<Prope...

Spring Entity to use Service, possible design flaw, but still....

Hi guys, The legacy database I'm "springwrapping" has Id's that are Strings and that give away some information. For instance, a UserId looks like "DK-6715-00001", meaning a user in Denmark, postal code 6715. This is so wrapped into the enterprise applications that it needs to be kept and my entities verify this in their setter methods....

Will Firefox do XSLT on external entities?

What I'm trying to do is take an XML document, let's say http://example.org/data.xml and show it with an XSL stylesheet applied. (I cannot modify the document itself and add a directive) So there are a couple of utility XML files like this: wrapper.xml: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE wrapper [ <!ENTITY content SY...

Any form generator(from annotated javabeans) for swing?

I've seen several form generators(swing, web etc from javabeans) but cannot find them again. Help me with links please. PS generator is not designer, generator - generates ui semi-automatically, no drawing is needed PPS I have finally found them nakedobjects jmatter metawidget if you know more please comment ...

Entities: Adding a Navigation Property between a View and Table

As you can seen in the diagram below there is a one-to-many relationship between the ProjectTask and Dependency table. Entities tries to map every field in the View to fields in the Dependency table, which wouldn't work. Any suggestions on how I can add the navigation property? Thanks, Abe ...

Problem with related entity on asp.net MVC create form using entity framework

Hi There I am building a very simple asp.net MVC file upload form. Currently I have a problem creating the new database object that stores info on said file. The code for the action method looks as follows: [Authorize(Roles = "Admin")] public ActionResult AddFile(Guid? id) { var org = organisationRepository.GetOrganisa...

Is Hibernate entity callback methods are only called by using EntityManager

Hi I used Spring's HibernateTemplate to save entity, I also add call back method like this @PrePersist public void prePersist() { setCreateDate(new Date()); } but I found this callback annotation was not called when I called saveOrUpdate() method. public void persist(Object entity) { hibernateDaoSupport.getHibernateTemp...

How to limit fetching of entities from SQL query.

SQLQuery query = session.createSQLQuery("select {o.id} from order o " + "LEFT JOIN bookings b ON b.id = o.bookingId " + ); List pusList = query.addEntity(Order.class) .list(); and in order class I have: @OneToOne(cascade = CascadeType.ALL, mappedBy = "order", fetch = FetchType.LAZY) private Trip trip; but during exec...

Where should I be creating the entity objects?

I have an entity class and an entity DAO class. Should it be the responsibility of the DAO class to create instances of the entity class, or should there be an entity creator/manager class that uses the DAO class only to get the data from the database to create the entity class. Thanks, Chris ...

Project to isolate entities in Seam

Hi guys, Is it possible to have a Seam project just for entities (src/main) and other projects access them ? I have a situation that a organization has 6 projects accessing the same entities and i don't want to replicate them in each project. If it is possible, how can i do that ? where can i found documentation about it ? thanks, C...

Core Data, iPhone, setting an attribute on an entity and retrieving it with "one-to-many" relations

Hi I have been through the Apple Developer guides and tutorials and I been through 2 iPhone books brushing on the subject of Core Data. I am used to handling the "value object"/"entity" side of things and then send them of to a web service or the likes. But on the iPhone I get to handle everything myself… cruel world:) The Locations, T...

NHibernate Validator with EntityMode.Map

I'm developing application with NHibernate EntityMode.Map so I have entities of IDictionary without cs domain model, database configures only with hbm files. It gives me lots of flexibility. I want to find out does NH.Validator support this EntityMode.Map too? If yes how to configure it properly, now I'm getting exceptions related to m...

Domain Driven Design - Repositories and aggregate roots

I have a domain model that contains a forum. I have forum, thread and post entities. The forum is a standalone entity. Ie it does not contain thread as part of an aggregate. This is because threads are not owned by a particular forum (you can move a thread to a different forum). I don't know if I should model posts as part of a threa...

An object with the same key already exists in the ObjectStateManager...

I have an entity model with (among others) following four entities: QCompany: - PK_Company - CompanyName - QAddress - a collection of addresses QAddress: - PK_Address - Streetname - QZipCode - QAddressType QAddressType: - PK_AddressType - Description QZipCode: - PK_ZipCode - ZipCode - Maildepot I try to do the following: I have an...

PHP function to encode & etc. characters to corresponding HTML entities

Hi Guys, Does anybody know of a PHP function to encode strings containing special characters like & etc. to strings containing corresponding HTML entities? The purpose is to display string data on a webpage without causing XML parsing errors. ...

C# Entity Framework Query...

I'm trying to figure out how to limit my child dataset to only include active records... // Here's what I have currently... m_BackLoggerEntities.Stories .Include("Sprints") .Include("Tasks") .Include("Efforts") .Include("Products") .First(s => s.StoryId == id); // Here's what I thought I could do.....

Persistence Using JPA Persistence.xml for Desktop App

I'm actually finishing a Desktop App That implements JPA for DB Communication. I Have a JPA Util class that does the following: private EntityManagerFactory emf = new EntityManagerFactory(); emf = Persistence.getEntityManagerFactory("default"); This "default" value is defined for my persistence.xml contained in the META-INF source fol...