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

learn more… | top users | synonyms

1
vote
2answers
135 views

How do I do SQL Server mapping with a new Desktop application written in C#? [closed]

In 2 weeks I will be starting a new job as a software developer in a company that currently does not employ any professional programmers. My first task will be to rewrite a Excel/VBA application in ...
0
votes
0answers
45 views

DDD using an ORM and a Active Directory Server for Persistence

With Domain Driven Design one would model out the domain. One would then use an ORM of some sort to take care of the persistence. Say you have a Product entity which has a Name, SKU and an Owner. This ...
1
vote
1answer
93 views

How to evaluate the performance of a Data Access Layer b/w two ORM's?

I am currently working on a project where I am going to replace the Data Access Layer from a custom ORM to Entity Framework.(The product is almost complete and mostly any changes that will follow ...
1
vote
1answer
64 views

What happens to database design process when ORM tools are used?

I have learned about database design, including normalization during my undergraduate course. When we have to model a database for a system, we can start with an ER model and then convert it to the ...
0
votes
2answers
107 views

Definition of the NHibernate Mapping by Code / EF Code First pattern?

Sub-questions: Does this pattern have a formal definition? Who invented it? Is it considered a DSL? The reason why I am asking is because I would like to better assess its applicability to ...
0
votes
1answer
53 views

Initialize object from SqlDataReader

As of now, we have two different styles of object intializations based on SQL row in our codebase: public Config(SqlDataReader sdr) { for (int i = 0; i < sdr.FieldCount; i++) if ...
0
votes
1answer
93 views

Database object mapping, good practices [closed]

I think I've understood the basic idea behind object mapping but there is one gap in my knowledge base that I hope to fill now. First let me tell you what I understand out of the whole thing. I have ...
2
votes
0answers
77 views

Unit testing Eloquent outside of Laravel

How can I unit test my Eloquent models when I'm using the ORM outside of Laravel? What I'm hoping to do it run tests on each model but somehow mock the database connection/query/builder(?) object. ...
1
vote
1answer
156 views

Does ORM at any point become a “requirement” for RESTful API?

I've started building a RESTful API in PHP's Slim framework. The framework appealed to me because of its light-weight design and routing features. I am using PostgreSQL for the database. However, ...
1
vote
1answer
253 views

Is DDD any good nowadays? [closed]

This is not a rant about DDD but rather some experiences and observations I've made through the past 2 years since I first learned about it. With this post, I'd like to hear what other programmers ...
0
votes
1answer
153 views

Implementing a NoSQL and RDBMS compatible DAO

What would be the correct way to design a DAO which implementation is first going to be targeting a MS SQL database with a STAR model, but yet, business requirements specify the application must be ...
0
votes
1answer
135 views

ActiveRecord equivalent in Java [closed]

My question is fairly simple.. What is the closest ORM to ActiveRecord that I'd be able to find for Java? In other words, in terms of thinking patterns and knowledge, with limted development time, ...
0
votes
1answer
75 views

Class Table Inheritance: do child tables need a primary key?

I'm using the Class Table Inheritance architecture with my application and have read Fowler. When mapping my database tables to classes in code, I've realized I have no need for an "ID" property on ...
1
vote
3answers
161 views

Limiting complexity in JPA programs Java/Hibernate

I've been working on a new application for some months now. It's my first big JPA program, and is still in the early stages. However, the complexity of my JPA object tree is becoming a growing ...
2
votes
1answer
103 views

What TDD/BDD tests should be writen to test an ORM

So I'm writing an ORM for NodeJS and using Mocha + Chai to test it. What I want to know is, what tests I should write to it, insertion tests should also have a querying test so I can check if the ...
2
votes
1answer
40 views

Solutions To Partial ORM Retrieval

I have read the following question regarding whether it is best to use objects with fully or partially populated data members. The 3 suggestions were: that perhaps using a fully populated ORM model ...
0
votes
0answers
151 views

Best approach to save relationship mapping of country,state,city in orm

I am building a project in play framework java with jpa and I want set country,state,city dropdown fields in a form to be dynamic(from database).So only admin can increase or decrease the value of ...
7
votes
3answers
202 views

How to model and store an entity which has “one or more” values

I'll use C# to design the model to be persisted Let's suppose I have the following entity: public class Episode { public int Id { get; set; } public string Title { get; set; } public ...
9
votes
2answers
370 views

Best practices for serialization of DDD aggregates

According to DDD domain logic should not be polluted with technical concerns like serialization, object-relational mapping, etc. So how do you serialize or map the aggregates' state without publicly ...
1
vote
0answers
109 views

Entity Framework and separating DAL from domain entities

If I have a normalized db, it's unlikely to map 1 to 1 with my domain entities. So I customize my EF entities to fit the domain. But now my EF entities are essentially my domain entities and my DAL is ...
2
votes
1answer
80 views

Creating/updating entity save strategy

Please note: although I'm talking about Java in this question, what I'm asking about here should really be language-agnostic. I am dabbling in OR/M for the first time, and have cooked up the ...
1
vote
1answer
442 views

Programmatically extending Hibernate table/entity definitions in Spring, how?

I would like to know if there is a way —maybe with AOP— to extend table/entity definitions so that I can add functionality across the board that requires persistence. Let me explain what I want to do ...
2
votes
5answers
217 views

Stored Procedures, ORMs and other application layers

I'm just starting out on a project to develop a new, fairly substantial web application which has an underlying MSSQL database. We're hiring a team of developers to write the application (in .NET) and ...
1
vote
0answers
107 views

Syncing structured data and files in Android App with an ORM?

I am developing an Android App which I have developed for iOS before. The app requires that structured data and files are synced across android devices. In iOS, I was using Core Data and synced to ...
1
vote
0answers
13 views

compare different approachs for saving related records whose values may change

On a web application for accounting services, I have the good old Invoice. To keep this example as simple as possible, each Invoice has many rows, and each row has its item with its price. At the ...
0
votes
1answer
55 views

Control (avoid) changing fields with side-effects

I have been thinking about a design problem and possible solutions in my own. I am pretty sure I am not the first one to have noticed it, but I cannot google for it since I do not know the standard ...
0
votes
1answer
94 views

Inverse property naming (ORM scenario) [closed]

I have a class that represents a process. In this process there are inputs boxes and output boxes. public class Process { public long ProcessId { get; set; } public virtual List<Box> ...
2
votes
2answers
58 views

How to ORM non-disjoint specializations

Consider this highly simplified sample of relational data (each table may be involved in one-to-many and many-to-many relationships not shown here): people +-------+------+--------+ | name | born | ...
2
votes
2answers
90 views

Domain/Model objects attributes good practices

Simple question: Should model/domain objects only include attributes that are meant to be persisted in a database or serialized to any other specific format? My understanding of a domain/model object ...
0
votes
0answers
33 views

Managing allocation calendars for an employee set [duplicate]

IN view of creating a MIS (Management Information System) one architectural/design issue that's confronting us is managing allocation for set of employees. Scenario: Employees get allocated to ...
6
votes
4answers
431 views

Heterogeneous Associations - Data Modeling When an Object that Must Relate to One of Many Classes

Suppose you have 3 classes: ClassA, ClassB and ClassC. Now suppose you have a class Message. You want a one-to-many relationship between each one of those three classes and the Message. The goal is ...
1
vote
1answer
69 views

How to associate both a collection and one item of this collection to an entity

I'm working on a project in which I have an entity, we may call Users and another entity Address. I want to define the entity User in a way that an user would have a collection of addresses ...
0
votes
1answer
35 views

Migrating single-layer ORM based app to multi-layer API

I'm trying to understand what is the best way of migrating a website that works in a single layer and gets all the data via an ORM, to one that uses multiple layers, using an API backend to get the ...
0
votes
1answer
266 views

Real time middleware system: Direct DB access vs REST API access

I'm developing a complex environment which involves a web application, a mobile app and a real time middleware system which accesses the DB for on-site tag readings. Currently, the web application ...
2
votes
1answer
99 views

Finding a way to simplify complex queries on legacy application

I am working with an existing application built on Rails 3.1/MySql with much of the work taking place in a JavaScript interface, although the actual platforms are not tremendously relevant here, ...
-1
votes
2answers
140 views

Data Access Objects old fashioned? [closed]

A couple of weeks ago I delivered some work for a university project. After a code review with some teachers I got some snarky remarks about the fact that I was (still) using Data Access Objects. The ...
1
vote
2answers
325 views

Limitations of the Identity Map pattern

After asking about the implementation in Ruby of the Identity Map pattern because the potential memory leak in long running server apps, I am considering my initial concept of that pattern. Initially ...
0
votes
2answers
879 views

Proper Query Object Pattern - NHibernate

I was looking to an alternative to Repository Pattern and I've read about "Query object pattern" (http://lostechies.com/jimmybogard/2012/10/08/favor-query-objects-over-repositories/). However the ...
0
votes
0answers
52 views

Extending database model of ORM in subproject

I have a maven project which contains some entities which are stored in a database. The purpose of this project is to manage personal information, users, locations, etc. This project can work on its ...
1
vote
2answers
115 views

How far can I drift from my original domain model and still have the benefits of an ORM?

I have the following domain models: public class User { public int Id { get; set; } public ICollection<Product> Products { get; set; } } public class Product { public int Id { ...
0
votes
1answer
216 views

Doctrine 2 and Concrete table inheritance

I use Doctrine 2 and I've read some articles on inheritance strategies' mapping with ORM. I've seen three main strategies : "Class table inheritance", "Concrete table inheritance" and "Single table ...
1
vote
3answers
264 views

PHP - Repository matrix pattern?

I'm trying really hard to refactor some of my legacy code in the project using best practices and design patterns + DDD so I'd love some feedback on an issue I'm currently having. Let's assume that I ...
-2
votes
1answer
511 views

How to use ORM in MVC?

If I want to use ORM in MVC system Which is/are correct? Use ORM object to replace Model Encapsulate ORM inside the Model Use ORM outside the Model, use ORM to access DB, and then use one instance ...
0
votes
0answers
66 views

Example of persisting an inheritance relationship using ORM

I have some experience with OOP and RDBs, but very little exposure to web programming. I am trying to understand what non-trivial types of problems are solved by ORM. Of course, I am familiar with the ...
1
vote
1answer
301 views

How do you handle domain logic that spans multiple model objects in an ORM?

So I know that business logic should be placed in the model. But using an ORM it is not as clear where I should place code that handles multiple objects. E.g. let's say we have a Customer model which ...
0
votes
1answer
285 views

Many-to-many in OOP: Class A instantiates Class B, which instantiates Class A, which

I am mapping Field1 to Field2. The map object instantiates the field object and vice versa, creating an infinite loop. This is in PHP. class field { protected $maps; // mapCollection object. all ...
2
votes
1answer
199 views

Persistence frameworks and common sense

I have studied some persistence frameworks mainly Hibernate, DORM, TMS Aurelius and I'm wondering. In a model of type: TOrderFiscal < > ----- > Items < > -------- > TOrderItem ...
0
votes
1answer
78 views

DB Design: How to link a single column to a collection of entities

I have a db design question that I am sure has been quite extensively covered but I cannot find a good answer already. The problem is how to efficiently link a single school course to a collection ...
4
votes
5answers
245 views

Is it bad software design to mix JDBC SQL calls and use an ORM in an application? [closed]

Is it bad software design to have JDBC/raw SQL and also use an ORM? I don't mind using an ORM for boilerplate CRUD, but some queries are better in SQL (for me). I'm not arguing for or against ORMs. ...
5
votes
4answers
8k views

How to get around the Circular Reference issue with JSON and Entity

I have been experimenting with creating a website that leverages MVC with JSON for my presentation layer and Entity framework for data model/database. My Issue comes into play with serializing my ...