entity

ADO Entity hierarchical self referencing

Hi, I have a self referencing table named categories that has a parentcategoryid column that is nullable. When I added the table to the entity designer it created two navigation properties for this relationship and I named one ParentCategory (the zero or 1 nav prop) and the other I named SubCategories (the * many nav prop). Everything...

Linq 2 Entities : Performing a join on two columns with different types

Hello, I'm currently using Entity framework, and I want to perform a Linq query with a join on two columns, one being of type 'String', and the other of type 'Int32'. Somethign similar to from FirstEntity obj in context.FirstEntity join SecondEntity obj2 in context.SecondEntity on obj.SecondEntityId equals obj2....

Dropdownlist and Entity objects

Hi there, I'm using Entity Framework and I want to bind a list of one of them to a dropdownlist. This is working well. But there's just one problem. What is the best practice to go to an outter object linked to the entity listed? I.E: A command which have ID, date, refCandidatID, etc. and for some reason, on my dropdownlist, i want to ...

LINQ-to-Entities or Entity SQL query

I need a LINQ-to-Entities or Entity SQL based query to handle the following scenario: Users belong to one or more Locations. Shipments belong to exactly one Location. Batches contain Shipments. Users should only see Batches where ALL of the Shipments in the Batch are from Locations they have access to. Example Batch: Shipment_1.Lo...

What am I missing with my Entity Framework?

Hi I have asp.net membership and I use the built in Create user method since it is convenient now after this depending on the user I want to add 2 more fields to the aspnet_UserTable. In my aspnet_user Table I have like this // All Standard Fields that come with this table ClubID<nullable) ClubName <nullable) I have a table that re...

ADO.NET Entity Generation Wizard Taking Hours

Hello, I'm currently working with Visual Studio 2008 and the ADO.NET Entity Data Model Wizard. I'm connecting to a MySQL database using the MySQL/Connector plug in available. I have a database with 63 tables, each with foreign key constraints on several columns. I'm working on the data access layer for a multi-tier system. The ADO.NET ...

how to get child table along with the parent in entity framework using entity sql like "select value tablename from tablename"

how to get child table along with the parent in entity framework using entity sql query for example var parentTable = "select value parentTable from parentTable as pt inner join childTable as ct on pt.key = ct.key"; doing this parentTable.childTable.count() returns 0. so how can i get the childTable loaded along with the parent table?...

Linq to Entities - Retrieve entity with "self-reference" from Stored Procedure

I can't quite figure this out. I have a table called Employee with and Id field. The table also contains a ManagerId field which has a foreign key pointing to the Employee's Id field. When I add the table as an entity to my entity data model it creates the new Employee entity with an EmployeeChildren collection element and an EmployeePar...

Is there a way to manually raise the PropertyChanged event of an EntityObject?

Hi I am trying to raise the PropertyChanged event of an EntityObject, I don't find a way to do it, is this possible? ...

Get annoted hibernate tablename from POJO

Hi guys, I have an entity which is declared roughly like: @Entity @Table(name = "myUserTable") public class User implements Serializable { ... } I'm making a generic DAO class, and in doing so I'd like to retrieve the "myUserTable" name. Is there any way I can reach this name? Cheers Nik ...

Bind Infragistics UltraWebGrid with Hierachical view to collection of objects

I have a list of entities that i want to bind to my UltraWebGrid. The Class definition of the entity has the following structure public class Parent { public Guid Id { get; set; } public String Name { get; set; } public IList<Child> Children { get; private set; } } public class Child { public Guid Id { get; set; } public Guid ...

Separate table for Value Objects on NHibernate

Hello, I'm new to DDD and NHibernate. In my current project, I have an entity Person, that contains a value object, let's say Address. Today, this is fine. But maybe one day I will have a requirement that my value object (in this case Address), will have to become an entity. Before trying to model this on a DDD-way, in a more data-cent...

DDD: subclasses & root entities

Hello. I'm new to DDD. Let's say I have the typical entity Car class Car : Entity { public double MaxSpeed { get; set; } public Color Color { get; set; } /* ... */ } This entity, in my domain model, would be the root entity of an Aggregate. Now let's say I specialize cars. I create a Ferrari, and the happy owners of Ferr...

Hibernate mapping inheritance

I have a class ClassA mapped to TableA. I also have a mapping for it and it has an entity-name of EntityA. Now, I need to create another mapping named EntityATwo between ClassA for TableA, but slightly different. Although I could copy-paste the mapping of EntityA to EntityATwo, it would be very difficult to maintain that. Thus, my q...

Detaching object from context in entity

I'm currently using EF and am running into this issue: The relationship between the two objects cannot be defined because they are attached to different ObjectContext objects. For the page load sequence, I am filling dropdownlists via this: using (DatabaseEntities db = new DatabaseEntities()) { MyDictionary = new Dictionary<Guid,...

&#145; &#147; &#233; == ‘ “ é, but on what encoding/reference?

I have a ColdFusion script that does: <cfset content = replace(content,"&##147;","""","all")> Which replaces &147; by ". Google understands this too, if you type &#145; &#147; &#233; at its search box its transformed on the results page to ‘ “ é". If I search for é on this HTML Entity Character Lookup page, it'll return &#233; to me....

(Fluent) NHibernate - problem mapping Id

Hello, I have a problem mapping an Id. The structures of the entities are as follows: public abstract class Entity<TEntity, TId> where TEntity : Entity<TEntity, TId> { public virtual TId Id { get; protected set; } public override bool Equals(object obj)... ... } public class EntityA<EntityA, long> : Entity<EntityA, long...

Retrieving dependent/parent from within domain entity method

How would one go about retrieving a dependent/parent object from an entity. $person->getAddress(); This should retrieve the Address object for that person from the database and return it as an object. Is this a good way to do it and how should the code look like if this is ok to do. Doing this would mean that the object itself should...

Entity Framework, Stored Procedures,ASP.NET GridView - Insert Empty Row

I want to add a empty row in my Grid. <asp:TemplateField> <ItemTemplate> <asp:ImageButton id="Insert" runat="server" CausesValidation="false" CommandName="Insert" OnClick="GridViewInsert" ImageUrl="~/Images/Grid/Insert.gif" /> In GridViewInsert Event: Award_Status_List list = new Award_Status_List(); list.Award...

Programmatically add row to entity data model context and have new row show up in databound datagridview

I have a datagridview that is bound to a bindingsource which is in turn bound to the an EDM object. I'm importing objects from a CSV file and wish to add these objects to the EDM context and have the new items show up in my datagridview. However, I do not want the new objects committed to the database until the user indicates the data ...