entity

How can I configure a JPA EntityListener via a Spring XML configuration file?

Hello, I have two webapps, that are built together and respectively provide a client and admin access to a database. I'd like to register two JPA EntityListeners to a given class, one in each app. To do that, I'm trying to find a way to register the listeners via the Spring XML configuration file that configure each app's JPA context.....

ICollection and EntityCollection

Hi, I am making an interface: ICollection<EF> FromDTOType(List<DTO> dto); which takes a DTO object and converts it to a ICollection. I would like to have done the following instead, but it is not possible since it is not an interface. System.Data.Collection.EntityCollection<EF> FromDTOType(List<DTO> dto); Is possible to easily c...

JPA Entity (in multiple persistence-unit) in OSGi (Spring DM) Environnement is confusing me.

Hi, I'm a bit confused about a strange behavior of my JPA's related objects. I have three bundle : The User bundle does contain some user-related objects, but mainly the User object. The Energy bundle does contain some energy-related objects, and particularly a ConsumptionTerminal which contains a List of User. The Index bundle doe...

Localized tables and Entity Framework

Hi all, I have a scenario where I need to localized values of objects in my database. Let's say you have an application that can create animals, if the user is english the value of the "Name" property of an animal would be entered as "Cat" in the UI whereas it would be entered as "Chat" in french. The animal culture table would contai...

ObjectQuery, passing datetime in Where clause filter

How to pass in Date Time value here? ObjectQuery<Item> _Query = ItemEntities.CreateQuery<Item>("Item"); _Query = _Query.Where("(it.StartDate >= 11/4/2009 5:06:08 PM)"); my sample code above does seem to work. even with this ObjectQuery<Item> _Query = ItemEntities.CreateQuery<Item>("Item"); _Query = _Query.Where("(it.StartDate >= \"1...

How to fluent-map this (using fluent nhibernate)?

I have two tables in my database "Styles" and "BannedStyles". They have a reference via the ItemNo. Now styles can be banned per store. So if style x is banned at store Y then its very possible that its not banned at store Z or vice verse. What is the best way now to map this to a single entity? Should I be mapping this to a single entit...

Generic Table<TEntity>

Hi everyone, Trying to use Linq to SQL for a small project I'm working on at home. I have generated a the context code and all my entity classes using dbmetal.exe (from the DBLinq project) against a local MySQL database. Everything is working great, but I'm trying to abstract some redundant code and I'm running into issues trying to do...

Value object or entity object in my Hibernate mapping?

Hey everyone, I'm trying to design a pretty simple app and am getting myself a bit confused with Hibernate's definition of entity and value objects (as defined in Chapter 4 of Java Persistence with Hibernate). What I have is an app with customers, who can place orders (one to many relationship). Each of these orders has many order line...

Hibernate entity with user defined attributes

Can someone please give me some tips on modeling hibernate entities that have some known attributes while the majority are defined by the user of the system (during initial setup of the system) I need to be able to search on these user defined attributes at a later point in time. ...

Fabricate entities with multiple IDENTITY PKs?

Disclosure: I'm a 'natural key' advocate myself and averse to the IDENTITY PK approach. But I do have a 'live and let live' approach to lifestyle choices, so no religious arguments here please :) I have inherited a table where the only key is the IDENTITY PK column; let's call it ID. There are a many tables that reference ID. The intend...

SQL Server backward compatibility in Entity Framework?

Is there any backward compatibility in the entity framework between SQL Server 2008 and 2005? It seems the framework forces you to use the same provider for all the .edmx files in a solution. If you use the 2008 provider, data types like DateTime2 and functions like SysDateTime that are emitted by the framework to the underlying SQL q...

Entity Framework - Many to many question

I have a table called ASB and a table called PeopleInvolved. There is a junction table called PeopleInvolved_ASB which simply contains an ASBID and a PeopleInvolvedID column. The columns act as a composite primary key. The designer does not show the junction table (as expected). I want to retrieve a list of PeopleInvolved based on an AS...

NHibernate: set entity from transient object based on unique field

My application obtains transient objects. MyClass Id Name OtherData Mapping is like Id is identifier and Name has unique constraint in database. The transient object has no Id yet of course, but has fulfilled Name property and all other properties. So I can write a criteria to get the entity from database based on that unique fi...

Entity Framework CreatedBy fields not updating

Using Entity Framework I have the fields: o CreatedOn (datetime) o CreatedBy (nvarchar(50)) o ModifiedOn (datetime) o ModifiedBy (nvarchar(50)) When I add data to my table it is not adding/updating data to these columns. Am I missing something? This is a similar question to subsonic CreatedBy fields not updating ...

Database visualization tool

I just watched a session of PDC09 about new features of Entity framework in .NET 4. Video page: http://microsoftpdc.com/Sessions/FT10 in the video, (seek to minute 7) presenter used a database visualzation tool to open table and view data. Does anyone know what's the name of it and where I can download? ...

linqpad 4.0 and code only

how do i linqpad with code only in ef 4. i mean how to reference metadata when there is no edmx file? ...

Is there an html entity equivalent of ▼?

Like &nbsp;. And what about other symbols? ...

Storedprocedure from Entity Context Object

Hi, I have created the stored procedure and mapped the function. Still I can not access function for the contextobject. Any idea? ( I did search on solution but string found only in .edmx XML) ...

hibernate @GeneratedValue correct?

I set my entity property @GeneratedValue Long id; and I able to generate id for the entity in database. My question is why all the entities are sharing the same incremental number? aren't each table should start counting from zero? ...

Core-Data: Print contents of an entity

Hi all, How would I print the contents of an entity e.g. customer? I want the data to be table like, e.g. the entity data should print like so: First Name | Last Name | Telephone Number | Email | DOB I also need to apply a search predicate before printing the data, e.g. print members born after 1984 Could anybody tell me how I should...