orm

How is Command Query Separation (CQS) implemented when using an ORM?

The principle behind the CQS architectural pattern is that you separate your queries and commands into distinct paths. Ideally, your persistence store can be read/write partitioned, but in my case, there is a single, normalized database. If you are using an ORM (NHibernate in my case), it's clear that the ORM is used when issuing comma...

Filters in Doctrine

nHibernate has a great feature called filters, so i can create criterias globally for my applications. I'm starting a project in PHP and i need to use an ORM, i'd like to know if Doctrine has a similar feature to manage query conditions. thanks ...

Coldfusion ORM Large Tables

Say if I have a large dataset, the table has well over a million records and the database is normalized so theres foreign keys and stuff. Ive set up the relations properly and i get a list of the first object applications = EntityLoad("entityName") but because of the relations and stuff the page takes like 24 seconds to load, even when ...

Which pattern does Hibernate follow?

In his book "Patterns of Enterprise Application Architecture", Martin Fowler talks about persistence patterns which are commonly found in software development and particularly in relation to ORMs. Is there a pattern that Hibernate adheres to most closely? ...

Do any Python ORMs (SQLAlchemy?) work with Google App Engine?

I'd like to use the Python version of App Engine but rather than write my code specifically for the Google Data Store, I'd like to create my models with a generic Python ORM that could be attached to Big Table, or, if I prefer, a regular database at some later time. Is there any Python ORM such as SQLAlchemy that would allow this? ...

Multiple Mappers for the same class in different databases

I am currently working on a Wikipedia API which means that we have a database for each language we want to use. The structure of each database is identical, they only differ in their language. The only place where this information is stored is in the name of the database. When starting with one language the straight forward approach to ...

how to have identity map in doctine ORM

need to use a good PHP ORM that has elements of Datamapper and i am not clever enough to code it myself. chosen doctrine, but after reading through the user guide, cannot find anything that says how to use identity map to lower calls to database. please show me how to have identity map in doctrine ORM? just read and understood stuff ...

What strategies can an ORM use to cache data while minimizing complexity?

If the application asks for a similar result set to one that has recently been requested, how might the ORM keep track of which results are stale and which can be reused from before without using too many resources (memory) or creating too much architectural complexity? ...

Is Wikipedia incorrect to say that an ORM just does type translation and not necessarily transfer of data?

According to the Wikipedia article object relational mapping: is a programming technique for converting data between incompatible type systems in relational databases and object-oriented programming languages I thought an ORM also took care of tranferring the data between the application and the database. Is that not necess...

What use does an ORM have for database metadata?

I was reading about ORMs and one of the descriptions I read said that the ORM interacts with database metadata. Why is this important or relevant? Metadata, as I understand, is just a way of describing what the database contains. So, for example, the database might have an internal table that lists what user tables have been created....

What's the best ORM for DDD?

I'd prefer a commercial solution. So not NHibernate. Now i'm playing with LLBLGen pro and i like it but it doesn't seem be DDD friendly. ...

Nhibernate - Mapping List doesn't update List indexes

Hi, I'm having one self-referencing class. A child has a reference to its parent and a parent has a list of children. Since the list of children is ordered, I'm trying to map the relation using NHibernate's . This is my mapping: <class name="MyClass"> <id name="Id"> <generator class="native"/> </id> <list name="Children" cas...

Fluent NHibernate HasManyToMany() Mapping Problem

Hi, i am having a problem in Fluent NHibernate example utilizing the Many-to-Many relationships, i tried to find out examples on a similar case, and i found tons , but still having the same problem. when run the test project the following exception is thrown: NHibernate.PropertyAccessException: Exception occurred getter of project.Enti...

How to organize a Data Base Access layer?

I am using SqlAlchemy, a python ORM library. And I used to access database directly from business layer directly by calling SqlAlchemy API. But then I found that would cause too much time to run all my test cases and now I think maybe I should create a DB access layer, so I can use mock objects during test instead of access database di...

Default size of text column in Rails (PostgreSQL)

If I have this in a migration: t.text :body How much text can I fit in :body? (I'm using PostgreSQL if that's relevant) ...

Django: AuditTrail & Lazy Relations

I've been trying to modify the AuditTrail code so that it does not copy ForeignKey fields, but rather copies the related field (ie I don't want a foreign key on my database table for the audit model). I've written a copy_field function that looks like so: def copy_field(field): while(isinstance(field, models.OneToOneField, models.F...

How to implement Synchronization Tag in django

We are making a synchronization between one master database and many slave databases over tight link (7kb). To minimize amount of data send we tag each record that was sent successfully. To do so we created following models: class SynchronizationTag(models.Model): STATUSES = ((0, "Invalid"), (1, "Pending"), ...

LLBLGen "Flattening" Table Relations

I currently have two entities in LLBLGen and would like to merge them together to output to a table to be used in a DevExpress GridControl in the same way that 2 tables joined together with an inner join. Does anyone know how to do this with LLBLGen? ...

Simple(r) ORM for PHP

What is the simplest ORM implementation around for PHP? I'm looking for something really simple and light (in terms of LOC, since speed it's not crucial I don't need caches and what not), preferably a single file or class package that doesn't depends on XML or other configuration files and it's easy to deploy. Reading other similar ques...

Can you represent an application object in a way that a relational database can understand?

Bill Karwin has a blog post called "Why Should You Use An ORM?" which is being discussed on Reddit and I was confused about a couple of points. In it he says in the comments section: OODBMS and ORM works only on objects that we've instantiated in the application layer. I.e. there's no way to do a query like this: UPDATE B...