Object-relational mapping (ORM) is a technique for mapping between object-oriented systems and relational databases.

learn more… | top users | synonyms

4
votes
3answers
162 views

What is a good rule-of-thumb for naming link-tables?

In the same way that a publication table might relate to a person table via subscriptions, or a company table might relate to a person table via employee, I'm wondering if there is a descriptive way ...
1
vote
1answer
430 views

Anything beneficial from ORM for a NodeJS project already plain-SQL-implemented?

Well, actually it's a assignment project and I've already implemented a simple yet functional forum with NodeJS. But now we've been required to use ORM frameworks to refactor part of your code worth ...
4
votes
6answers
5k views

What are the disadvantages of using stored procedures, SSIS, and SSRS to implement business applications? [closed]

Recently, it was suggested that many projects (where I work) should be implemented using some combination of stored procedures (on SQL Sever / T-SQL), SSIS, and SSRS. In one specific project, SSIS ...
0
votes
2answers
228 views

What is the convention regarding class names that may already exist in the ORM?

This is a generic question about class names and ORMs, but for context; I'm working on a Flask web app in Python using SQLalchemy. I'm struggling with naming a new class that will contain the ...
2
votes
1answer
719 views

Using a DAO to abstract our ORM from the rest of the application

We're using MySQL with Sequelize.js as the ORM. What we're wondering is whether a DOA layer of abstraction is worthwhile. Here are our options: To use the Sequelize models throughout the ...
0
votes
2answers
419 views

Mapping a legacy database to ORM using wrapper classes

I want to use an ORM with a legacy database, but I don't want to expose some of the underlying data types. For example, some of the columns are nullable doubles or floats and I want my domain model to ...
1
vote
2answers
496 views

What is the equivalent of Entity Framework in the world of Oracle shops? [closed]

Within the world of developers/firms specializing in building/deploying solutions built around software built/sold by Oracle (aka "Oracle houses"), what ORM middleware is considered as the "industry ...
0
votes
1answer
125 views

What is a good design for a container, assignment and items

------------- 1 * -------------- * 1 -------- | Container |--------| Assignment |-----------| User | ------------- -------------- -------- ^ ...
5
votes
1answer
150 views

Should I Use an ORM only when dealing with Data Model objects?

I am new to ORM, and we started developing a new system using NHibernate as the ORM. I think this question may refer to any ORM and any language/platform. The Team Leader has said we should use ...
2
votes
1answer
207 views

Sorting rows off an autoincrementing primary key

Is it a bad practice to rely on an auto-incrementing primary key to sort rows in a table? A coworker and I were having an argument about this subject. We need to be able to find the last-inserted row ...
4
votes
3answers
475 views

How do ORM'S manage CRUD operations in multi thread environment

Suppose I have code which retrieves an object and modifies it and submits it via any ORM from a web application. Below is the pseudo code: First request var objCust = ...
1
vote
1answer
210 views

ORM: Keep entities coherent in a cache or retrieve entities each time?

We have a tricky question in a project using Java & Hibernate, with a model containing bi-directional relationships. As it's a small project with few users, few entities, and few rows involved in ...
5
votes
1answer
429 views

Entity Framework as a type checking/verification system for database code

When I read pro and con lists of using Entity Framework (or any modern ORM really), I'm surprised that the following point doesn't arise (self quote): Using strongly-typed domain entities allows ...
4
votes
2answers
1k views

Do we achieve 100% Persistence Ignorance solution if we're not using ORM's POCO objects to model the Domain?

Persistence ignorance is ability to retrieve/persist standard objects, where standard objects are considered as classes focused on particular business problem and thus don't contain any ...
6
votes
6answers
1k views

OOP Design: relationship between entity classes

I have at first sight a simple issue but can't wrap my head around on how to solve. I have an abstract class Compound. A Compound is made up of Structures. Then there is also a Container which holds 1 ...
0
votes
0answers
112 views

Benchmarking ORM associations

I am trying to benchmark two cases of self referential many to many as described in datamapper associations. Both cases consist of an Item clss, which may require many other items. In both cases, I ...
5
votes
4answers
267 views

Where ORMs blur the lines between code and data, how do you decide what logic should be a stored procedure, and what should be coded?

Take the following pseudocode: CreateInvoiceAndCalculate(ItemsAndQuantities, DispatchAddress, User); And say CreateInvoice does the following: Create a new entry in an Invoices table belonging to ...
5
votes
3answers
623 views

Should we have a database independent SQL like query language in Django?

Note : I know we have Django ORM already that keeps things database independent and converts to the database specific SQL queries. Once things starts getting complicated it is preferred to write raw ...
8
votes
1answer
750 views

Classless tables possible with Datamapper?

I have an Item class with the following attributes: itemId,name,weight,volume,price,required_skills,required_items. Since the last two attributes are going to be multivalued, I removed them and ...
8
votes
3answers
834 views

Creating a layer of abstraction over the ORM layer

I believe that if you have your repositories use an ORM that it's already enough abstracted from the database. However, where I am working now, someone believe that we should have a layer that ...
5
votes
2answers
159 views

Database Change Auditing - Part of or Abstracted from ORM / Application Layer?

My fellow developers and I are at a crossroads in how to go about continuing our auditing of database changes. Most of our applications log changes via INSERT, UPDATE, and DELETE triggers. A few of ...
29
votes
4answers
7k views

Entity Framework with large systems - how to divide models?

I'm working with a SQL Server database with 1000+ tables, another few hundred views, and several thousand stored procedures. We are looking to start using Entity Framework for our newer projects, and ...
1
vote
5answers
4k views

Externalising SQL Queries in Java

What are the advantages and disadvantages of externalising SQL queries in Java (or similar general-purpose object-oriented programming language. Externalizing means storing all SQL in a separate ...
3
votes
3answers
933 views

How do I make code bound to an ORM testable?

In Test Driven Development, how do I make code bound to an ORM testable? I am using a Micro-ORM (PetaPoco) and I have several methods that interact with the database like: AddCustomer UpdateRecord ...
5
votes
2answers
745 views

Returning an IQueryable from an IRepository

Using the Repository pattern, is it proper to return an IQueryable of a data set (table), for generic usage? It is very handy in many cases, especially when using external libraries that leverage ...
3
votes
1answer
353 views

What is the best way to use inheritance with ORMs?

If I have a People table and those people can be at different addresses, and each address can have more than one person, thats a many-to-many relationship. So, using ORMs like Entity Framework and ...
12
votes
5answers
20k views

What are the advantages of myBatis over Hibernate? [closed]

I've done some research on my own and understand the basic concept. But some insights can only be gained through actual experience. What are the advantages of myBatis that would make it worth ...
2
votes
1answer
2k views

is it possible to auto-generate annotated POJO from a table

I wonder is it possible or is there a tool to generate annotated POJOs from a table.To make it clear,for example,Person table has fields like ,id,name,surname etc and i wanna to generate a POJO named ...
1
vote
1answer
494 views

Abstraction Layer over ORM Generated Entities

I am learning LINQ to SQL (and planning to learn Entity Framework). Initially I used a abstraction layer to convert LINQ to SQL entities into a domain objects. Later I discovered the “Inheritance ...
1
vote
1answer
300 views

Are separate business objects needed when persistent data can be stored in a usable format?

I have a system where data is stored in a persistent store and read by a server application. Some of this data is only ever seen by the server, but some of it is passed through unaltered to clients. ...
18
votes
2answers
7k views

Does it make sense to use ORM in Android development?

Does it make sense to use an ORM in Android development or is the framework optimized for a tighter coupling between the UI and the DB layer? Background: I've just started with Android development, ...
2
votes
2answers
264 views

ORM and component-based architecture

I have joined an ongoing project, where the team calls their architecture "component-based". The lowest level is one big database. The data access (via ORM) and business layers are combined in various ...
1
vote
2answers
215 views

ORM has schema to generate classes, does the reverse exist? [closed]

In Entity-Framework, you can create a DB schema, and then generate your ORM classes. Is there any software that does this in reverse? For example you create a few classes that have relationships, ...
4
votes
1answer
422 views

What is Rainbow (not the CMS)

I was reading this excellent blog article regarding speeding up the badge page and in the last comment the author waffles (a.k.a Sam Saffron) mentions these tools: dapper and a bunch of custom ...
9
votes
2answers
506 views

Non-blocking ORM issues

I asked a question on SO, and found that there are no non-blocking ORMs for my favorite web framework. By non-blocking I mean an ORM with callback support for asynchronous retrieval. The ORM would be ...
12
votes
5answers
816 views

For an ORM supporting data validation, should constraints be enforced in the database as well?

I have always applied constraints at the database level in addition to my (ActiveRecord) models. But I've been wondering if this is really required? A little background I recently had to unit test a ...
0
votes
2answers
327 views

Will TSQL become useless because of new ORMs? [closed]

By introducing LINQ to SQL, I found myself and my .NET developer colleagues gradually moving from TSQL to C# to create queries on the database. Entity Framework made that shift almost permanent. Now ...
2
votes
4answers
363 views

Should OO design, or database design, drive the coding of my @Entity classes?

I have two classes that I want related to each other in an JEE application using JPA2. In an OO world, I would say that a Chatroom has an attribute List messages. In the relational world composition ...
0
votes
4answers
2k views

Is there really Object-relational impedance mismatch?

It is always stated that it is hard to store applications objects in relational databases - the object-relational impedance mismatch - and that is why Document databases are better. However, is there ...
2
votes
1answer
713 views

Basic design of a data access layer using the DataMapper pattern

I'm trying to understand the DataMapper pattern by implementing it myself for one of my domain objects. So far, I have: class MyDomainObject <attributes> <business logic methods> ...
3
votes
4answers
762 views

In Search of Automatic ORM with REST interface

I have this wish that so far Google hasn't been able to fulfill. I want to find a package (ideally in PHP, because I know PHP, but I guess that's not a hard requirement) that you point at a database, ...
5
votes
3answers
1k views

Thick models Vs. Business Logic, Where do you draw the distinction?

Today I got into a heated debate with another developer at my organization about where and how to add methods to database mapped classes. We use sqlalchemy, and a major part of the existing code base ...
2
votes
2answers
229 views

Does SRP with ORM provoke SOA?

Sorry about the many abbreviations in the title... My observation is that applications built with an object-relational mapping like Hibernate tend to follow a service-oriented architecture instead of ...
17
votes
5answers
1k views

Do ORMs enable the creation of rich domain models?

After using Hibernate on most of my projects for about 8 years, I've landed on a company that discourages its use and wants applications to only interact with the DB through stored procedures. After ...
8
votes
5answers
5k views

When not to use ORM and prefer stored procedures?

I am using PetaPoco micro-ORM. It is indeed very easy and secure to work with databases using ORM tools, but the only thing I hate is extra code. I used to put most of the code in the database itself ...
3
votes
1answer
76 views

Is there any scenario where it's useful to keep mutable properties cached in domain objects for anything else than informational purposes?

Usually in a domain model, you'll have objects, and those objects will have properties that are mutable and properties that are immutable - for instance, a instance id/name will be immutable, while ...
1
vote
2answers
276 views

Pro's/Con's to database table layout as it relates to maintenance & extensibility

Basic pseudo class layout below... class Location(): # Class containing information about a location. id address_one class CustomerLocation(Location): customer_id account_rep class ...
5
votes
2answers
306 views

Immutable design with an ORM: How are sessions managed?

If I were to make a site with a mutable language like C# and use NHibernate, I would normally approach sessions with the idea of making them as create only when needed and dispose at request end. ...
5
votes
2answers
2k views

How can I design a model layer without ORM, and when should I use it?

I'm a PHP developer who started with CodeIgniter. In it, designing models was easy: it seemed like each method defined in models was the equivalent of static methods in a normal, objected-oriented ...
3
votes
1answer
160 views

Who's responsible for a master / slave switch?

We are introducing a master / slave replication schema in our web application. At certain scenarios we would prefer to explicitly direct reads to a slave and writes to the master, which to me is an ...