orm

Should rules like "A parent object will have up to 2 children" be duplicated in database

Rules like "A parent object will have up to 2 children" could be enforced in database using triggers. But would it be a good idea to duplicate the rule if this rule is already enforced in the domain layer. In which cases duplication of such rules are justified? Are there any alternative to avoid such duplication? Is it not a data integ...

.NET ORMs - What advantage does NHibernate (or SubSonic or whatever) give over using Entity Framework?

I'm wondering, what are the main reasons for not to use the built-in Entity Framework? I've read that it's disliked because of its bad implementation, but is this all? And is it still true? (I don't remember the publish date of the article) I know there exist a lot of options, but why should I consider switching? I only have a little e...

Is there an ORM out there that supports ESE?

Well, I started writing a managed ORM for ESE based on the ESE interop project. I was wondering if anyone knows of any other ORMs out there that support ESE? ...

Best ORM tool for Oracle with 4000 tables

I am looking for the best .Net ORM tool that would work with Oracle and SQL Server 2005. We have an Oracle database with around 4000 tables. I tried TierDeveloper and Codesmith and they are not responding when I try to map objects with my Oracle DB. Which will be the best ORM tool to work with a big Oracle db? ...

What's the difference between different mapping types in Hibernate?

I'm a newbie in Database design and in Hibernate too. I started reading the documentation for Hibernate. It talked about "Collection Mapping", "Association Mapping" and "Component Mapping". I am not understanding the difference between them and not sure about when to use what in one-to-many/many-to-one/many-to-many relationships. To me, ...

How can I allow Duplicate Records in a Doctrine Collection

I'm hoping there are some fellow doctrine users out there. Here is a simplified YAML of my relationships: Collection: columns: id: { type: integer(4), notnull: true, primary: true, autoincrement: true } name: { type: string(255), notnull: true, unique: true } relations: Items: class: Item re...

Some suggestions on which .NET ORM to look at learning

I am a little ashamed to say that I have never used an ORM; as you may recall most of my career experience is hacking around with Classic ASP and the little .NET I do tends to be maintenance only. For my own career as well as in preparation for a new project at work (done in .NET finally!) I'm looking at adding an ORM to my skillset - b...

Why do we still use DataSets in .NET?

DataSets were one of the big things in .NET 1.0 and even now when using .NET 3.5 I still find myself having to use them....especially when I have to call a stored proc which returns a dataset which I then end up having to manually transform into an object to make it easier to work with. I've never really liked DataSets and have found th...

NHibernate HQL's Equivalent to T-SQL's TOP Keyword

What is NHibernate HQL's Equivalent to T-SQL's TOP Keyword? Also what is the non-HQL way for saying give me the first 15 of a class? ...

Easiest to learn and use .NET ORM framework?

We are re-writing one of our core web applications and I finally got the all clear from management to replace the horrible tangle of stored procedures with an ORM framework for implementing our data access layer. Hooray for me. Now I have to choose one. I have played around a little bit with the following NHibernate Castle ActiveRec...

ADO EF - Errors Mapping Associations between Derived Types in TPH

Background: I am writing a data access library using the ADO Entity Framework in Visual Studio 2008 SP1 using the .NET Framework 3.5 SP1. I am trying to create associations between two entities that are both derived from an abstract type. I am representing both entity inheritance hierarchies using Table Per Hierarchy (TPH) which means...

Defining the database schema in the application or in the database?

I know that the title might sound a little contradictory, but what I'm asking is with regards to ORM frameworks (SQLAlchemy in this case, but I suppose this would apply to any of them) that allow you to define your schema within your application. Is it better to change the database schema directly and then update the column types in yo...

NHibernate mapping: Entity1 -> ValueType1-> Entity2

I have a following domain model: Entity1 -> ValueType1-> Entity2 How can I write the mapping file to represent the above situation (while retrieving Entity1)? PS: I know I can use component tag when value type does not refer to another entity (in this case Entity2). Thanks ...

What is a good naming convention for domain objects versus their relational tables?

I have seen this issue twice now and want to see what a best practice is for resolving this naming convention. Suppose I have an ORM (Linq to SQL in this case) and I map a table called User. Then I create my POCO called User also. Although the mapped table exists in something like MyApp.Data.User and the POCO resides in something l...

2x one-to-many relationships in OO

Imagine these relationships: 1 A has many B's 1 B has many C's... In reverse: C has 1 B B has 1A By transitivity, C has 1 A To model this relationship in DB, we have: TableA a_id TableB b_id a_id (fk to TableA) TableC c_id b_id (fk to TableB) To model this relationship in OO, we have: objA objB objC And... - objB has re...

ORM vs Handcoded Data Access Layer

I'm a bit scared to ask this question as it may start a religous war so I want to be really clear on what I'm looking for. I'm looking for a reason(s) why you would or have jumped one way or the other and also for items to add to my lists. I'm looking for the big ticket, big bang items. Also, items specific to a product, maybe, if they a...

What are the best practices for functional programming and database interaction?

I know that in pure object-oriented languages like Java it usually makes sense to use ORMs like Hibernate. But what would I do when writing a CRUD-type functionality in Clojure or Common LISP? Passing around SQL as the first-order functions? But isn't having SQL in HTML-generating code very ugly? Thanks, Olek ...

Entity Framework - Table Per Type Inheritance - Existing Database

I want to implement Table Per Type inheritance with Entity framework for an existing database. The database: The inheritance for ImageParagraphs works perfect, but I am not able to make a Table Per Type inheritance with LinkListParagraph because of the different primary keys (ParagraphID; ParagraphID+LinkID): Error 1 Error 3003:...

What ORM to Run: telerik Open Access VS Subsonic VS linq to sql VS Active Record

We are looking into using an ORM and I wanted some opinions/comparisons The basic criteria we have for an ORM is: Easy to use/configure(short learning curve), flexible, the ability to abstract it away, easy to maintain Here is a list of what ORM we are looking at and what our initial impressions are Open Access - seems really ...

Which ORM tool should I use for .Net development

My company is looking to use an ORM for new development in .Net. We are currently looking at nHibernate, because of its popularity, however LLBLGen is another option that we may consider. Cost is not a primary factor. We need a solution that provides good separation of the domain model from the database, a good caching strategy, developm...