orm

Does JPA support mapping to sql views?

I'm currently using Eclipselink, but I know now days most JPA implementations have been pretty standardized. Is there a native way to map a JPA entity to a view? I am not looking to insert/update, but the question is really how to handle the @Id annotation. Every entity in the JPA world must have an ID field, but many of the views I have...

Large/complex dataset for ORM validation?

I'm looking for freely available sample data to do some ORM validation and performance testing on. My main requirements are: Discriminated types: it needs to include some kind of inheritance eg Party -> Person and Organisation; Reasonably complex data model; Some reasonably large tables (in the hundreds of thousands of rows at least);...

Best way to model Customer <--> Address

Every Customer has a physical address and an optional mailing address. What is your preferred way to model this? Option 1. Customer has foreign key to Address Customer (id, phys_address_id, mail_address_id) Address (id, street, city, etc.) Option 2. Customer has one-to-many relationship to Address, which contains a field...

Features - NHibernate versus Writing Custom Object-Relational Mapper

I'm looking for a list of all the features you would have implement in a custom object relational mapper (ORM) to meet all the features of NHibernate. to start: database portability through different drivers and dialects caching lazy loading custom SQL query interface - LINQ, Criteria, QBE (Query By Example) basi...

Using Magento's addFieldToFilter to filter by existing columns

Hypothetical situation. I want to populate/load a sales/order collection with every order where the grand_total is equal to the total_paid. I know I can use addFieldToFilter to filter by a specific value, but is it possible to use this method to filter by other database values. If not, is there any data access object in the Magento sys...

Is Dataset an ORM?

I am a little bit confused about Dataset compared to ORM (NHibernate or Spring.Net). From my understanding the ORM sits between the application layer and the database layer. It will generate the SQL commands for the application layer. Is this the same as what Dataset does? What is the difference between the Dataset and ORM? What are the ...

What differentiates Nhibernate from other ORM’s?

Apart from the fact that it’s open source and mature, what are the differentiating factors that separate nhibernate from rest of the .net ORM frameworks like Subsonic, ADO.NET Entity Framework etc? Better put, why should I choose nhibernate over other .net entity frameworks? ...

questions about ORM mappers like nhibernate etc.

Hi, Few questions on ORM mappers like nhibernate (for .net/c# environment). When queries are run against a sqlserver database, does it use parameter sizes internally? paramaters.Add("@column1", SqlDataType.Int, 4) Do they all use reflection at runtime? i.e. hand coding is always a tad faster? does it support temp tables, table variab...

What ORM would you recommend?

Here's my reqiurements: Supports C# Supports Oracle Supports LINQ Has ability to map business objects to database tables (not necessarily a 1-to-1 mapping) I know an Oracle Entity Framework provider would support all these, but I've been told that making the custom mappings is not very easy. What would you suggest? ...

Entity Framework vs alternatives

Duplicate: What ORM frameworks for .NET Do You Like Best? What are you currently using for data access? When choosing an ORM, is LINQ to SQL or LINQ to Entities better than NHibernate? Database (and ORM) choice for an small-medium size .NET Application Etc. What OR\M would you recommend for a large ASP.NET application, Entity Framew...

How do I pass a list of Qs to filter for OR lookups?

How do I pass a list of Qs to filter for OR lookups? Something like: q_list = [Q(xyz__isnull=True), Q(x__startswith='x')]? Without a list I would do: Model.objects.filter(Q(xyz__isnull=True) | Q(x__startswith='x')) ...

NHibernate many-to-one fetching same item many times

In my model I have Games. Each Game has an Event associated with it, which is mapped as a many-to-one association. When I query for Games, within event with given EventId (different than its DB-PrimaryKey-id) NHibernate issues the following query for each and every Game: NHibernate: SELECT event0_.Id as Id8_0_, event0_.EventId as Event...

How do you handle Foreign Key Relationships in model classes

Let's say I have a Project table with a FK CompanyId which relates the project to a company Table. In your Project model, do you add a Company object, or just the CompanyId property and retrieve the Company when needed in code? ...

Nhibernate and MS Access

Can NHibernate be used as ORM tool for MS Access? We are using Nhibernate to access Sql Server, so wondering if it can be reused. If it can be used how has the experience been? ...

Large volume database updates with an ORM

I like ORM tools, but I have often thought that for large updates (thousands of rows), it seems inefficient to load, update and save when something like UPDATE [table] set [column] = [value] WHERE [predicate] would give much better performance. However, assuming one wanted to go down this route for performance reasons, how would you ...

ORM: OneToOne mapping on Non Primary-Key Join column - Book and Inventory mapped by ISBN

I have a Book model and Inventory model mapped by ISBN number, but ISBN is not the primary key in either. Books belong to Bookstores and Inventory is for a group of Bookstores(BookstoreChain). Inventory is shared by all Bookstores belonging to a BookstoreChain. I'm using Hibernate @OneToOne mapping on the book side to fetch inventory i...

.Net ORM that works well with MySQL

My C# Windows Service ( It's a service, not a MVC web application!) needs to talk to MYSQL database. In order to ease my data layer effort I am thinking about using an ORM for this purpose. So which .Net ORM works most well with MYSQL database? NHibernate? Subsonic? Entity Framework (haha)? LINQ2SQL( no, this can't be the choice, can it...

Question about Repositories and their Save methods for domain objects

I have a somewhat ridiculous question regarding DDD, Repository Patterns and ORM. In this example, I have 3 classes: Address, Company and Person. A Person is a member of a Company and has an Address. A Company also has an Address. These classes reflect a database model. I removed any dependencies of my Models, so they are not tied to a...

Object Relational Mappers in .NET and stored procedure usage

Given that they generate the Create, Read, Update, and Delete (CRUD) functionality for you in most cases, does this imply that stored procedures won’t be used as often? If these methods use LINQ then that means no stored procedures are used, correct? Any clarification is greatly appreciated. ...

Django ORM: caching and manipulating ForeignKey objects

Consider the following skeleton of a models.py for a space conquest game: class Fleet(models.Model): game = models.ForeignKey(Game, related_name='planet_set') owner = models.ForeignKey(User, related_name='planet_set', null=True, blank=True) home = models.ForeignKey(Planet, related_name='departing_fleet_set') dest = model...