entity

Need to replace HTML single-quote entity in MySQL

Hi, I currently have the following MySQL statement to replace the HTML entity for a single quote with an actual single quote: update photo_galleries replace(title, ''', '\''); This statement returns an error. I have tried adding additional backslashes, but this does not help at all. I want to run this command using pure SQL (no PH...

Export Core Data Entity as text files in Cocoa

Hello, I have an entity in core data that has 2 Attributes. One that is a string called "name", and another one that is a string called "message". I need a method to create text files for all the attributes that the user has added. I wan't the files names to be the name attribute and the contents to be the message attribute. If anyone ...

FluentNHibernate Unit Of Work / Repository Design Pattern Questions

Hi all, I think I am at a impasse here. I have an application I built from scratch using FluentNHibernate (ORM) / SQLite (file db). I have decided to implement the Unit of Work and Repository Design pattern. I am at a point where I need to think about the end game, which will start as a WPF windows app (using MVVM) and eventually implem...

Is there any way to know that an EF4 entity is rehydrating?

And, if not, what pattern should I use when adding this into the T4 templates? ...

GAE modeling relationship options

Hi there, I need to model the following situation and I can't seem to find a consistent example on how to do it "correctly" for the google app engine. Suppose I've got a simple situation like the following: Company 1 -----> M Store A company has one to many stores. Each store has an address made up of a address line 1, city, state, ...

JPA - Removing entities

I have a Story entity with the following associations: Story <1-*> Chapter Story <1-*> Comment Story <*-1> User What is the correct way of removing this entity and handling the all the entities that is referring to? Is there some shorthand way of specifying that associated entities must be handled automatically or is the @PreRemove a...

How to map EnumSet (or List of Enums) in an entity using JPA2

I have entity Person: @Entity @Table(schema="", name="PERSON") public class Person { List<PaymentType> paymentTypesList; //some other fields //getters and setters and other logic } and I have enum PaymentType: public enum PaymentType { FIXED, CO_FINANCED, DETERMINED; } how to persist Person and its list of enums (in...

What .Net Namespace contains Entity for use in a generic repository?

I have a question that I'm ashamed to ask, but I'm going to have a go at it anyway. I am creating a generic repository in asp.net mvc. I came across an example on this website which I find to be exactly what I was looking for, but there is one problem. It references an object - Entity - and I don't know what namespace it is in. I typical...

mvc update creating not updatng in entityframework

IM using c# and MVC and the entity framework, now i have an entity that i am passing through to the model of the view for an update, my edit post back takes back the entity and a few extra fields that i am using editors for. i have a repository manager and it has a entity context, however when i call savechanges on my repository base (sh...

Entity Relationship Model: Ternary Relationships

Hi, I am trying to understand why this statement in the book is wrong: "given a C entity, there is at most one related A entity and at most one related B entity". Is it that it doesn't apply to a specific kind of relationship?? So, if I have an example of a student who is in attendance to a course with a type of subject. The entities ...

insert and modify a record in an entity using Core Data

I tried to find the answer of my question on the internet, but I could not. I have a simple entity in Core data that has a Value attribute (that is integer) and a Date attribute. I want to define two methods in my .m file. First method is the ADD method. It takes two arguments: an integer value (entered by user in UI) and a date (curr...

Database Instance

I read a statement from an exercise: construct a database instance which conforms to diagram 1 but not to diagram 2. The diagrams are different n-ary relationships that have different relationships. Diagram 1 has a many to one to many to one relationship. Diagram 2 has many to many to many to one relationship. So, to really understand th...

Cast MyEntity To LinqEntity throw a base controller class

hi there i design a multilayer we appliction andusing LINQ a my data provider i need to user my own Entites instead o LINQ etities. so i created Entities Project and create my entities in it. when i get data from contex and cast them to my entities , everything is ok. but when i want to cast on of my entities to linq entity , an excepti...

Copying from EntityCollection to EntityCollection impossible?

How would you do this (pseudo code): product1.Orders.AddRange(product2.Orders); However, the function "AddRange" does not exist, so how would you copy all items in the EntityCollection "Orders" from product2 to product1? Should be simple, but it is not... ...

Why is this Exception?- The relationship between the two objects cannot be defined because they are attached to different ObjectContext objects.

I m getting this Exception-"The relationship between the two objects cannot be defined because they are attached to different ObjectContext objects." I ve user table and country table. The countryid is referred in user table. I am getting the above Exception when I am trying to add entry in user table. This is my code- using (MyConte...

.DBML file and LINQ to SQL

In my DBML file I have mapped some tables and stored procedures, and the stored procedures return type is ISingleResult . T is some mapped table. But I want to take the data into my own created entities rather than LINQ to SQL created entites. The entites created by me are also the same as the mapped table entities and their use lies whe...

iPhone - Create non-persistent entities in core data

Hi everyone, I would like to use entity objects but not store them... I read that I could create them like this: myElement = (Element *)[NSEntityDescription insertNewObjectForEntityForName:@"Element" inManagedObjectContext:managedObjectContext]; And right after that remove them: [managedObjectContext deleteObject:myElement]; then ...

Entity Framework and WCf

Hi I am little confused on designing WCf services with EF. When using WCf and EF, where do we draw this line on what properties to return and what not to with the entity. Here is my scenario I have User. Here are the relations. User [1 to many] Address, User [ 1 to many] Email, User [ 1 to many] Phone So now on the webform, on pa...

special characters to html entity using php

I want to convert special characters like ñ, Ñ to htmlentities using php. I tried using htmlentities, but instead of returning "&ntilde" for its value it returns "ñ" as its value. ...

Saving my own created entites while updating in EDMX.

Hi, I have created my own entities in edmx i.e. temp table for a stored procedure. Now when i update my EDMX and adds or update any table, the entity which i created (for temp table) is removed from SSDL portion. Is there any way that my changes are not lost. Mean can extend EDMX or any other way..... Thanks... ...