orm

Which ORM Supports this

I have an optional part of query that needs to be executed on a certain condition. Here is the example code: int cat = 1; int UserID = 12; string qry = "select * from articles"; if(cat > 0) qry += " where categoryID = " + cat; if(UserID > 0) qry += " AND userid = " + UserID; //The AND may be a WHERE if first condition is fals...

A list of Entity Framework providers for various databases

Which providers are there and your experience using them I would like to know about all possible native .net Framework Entity Framework providers that are out there as well as their limitations compared to the default Linq2Entities (from MS for MS SQL). If there are more for the same database even better. Tell me and I'll be updating th...

Which ORM Supports Multiple row Updates and Deletes

I have a query that deletes all rows that have been marked for deletion. There is a column in a table that is named IsDeleted. It is a boolean data type if it is true the row is suppose to be deleted along with all related rows in different tables. If an article row is marked for deletion then the article comments, votes are also supos...

many-to-many relationship in doctrine

I've got some tables on my system like these: news --id --title --content video --id --title --url album --id --title Now, I need to do a many-to-many relatioship with this tables, but in a flexible way. I created a table called 'links' with the below structure: links --parent_entity (example: news) --parent_id (example: 5) --chi...

Really complex LINQ (to SQL) query example

We're thinking about adding more LINQ tests for ORMBattle.NET, but have no more ideas. All LINQ tests there are checking common LINQ functionality: Any test must pass on LINQ to IEnumerable For any test, there must be at least one ORM, on it passes (actually it doesn't matter if it is listed @ ORMBattle or not). Currently the goal of...

A recommended ORM tool for asp.net or help with SubSonic3 simple repository

Hi, I'm wanting to use an ORM tool for an asp.net web app I'm working on. I've put together all my classes and just want to have the data persisted. I downloaded SubSonic 3.0 and began using the simple Repository...which was brilliant. I'm new to ORM tools as my first experience commercially was the DataSets/Stored Procs world for a few...

Defining Model Relations for ACL Interface (gui) with CakePHP

Hello, I have set up Auth and ACL successfully on my cakePHP app. How, now i want to build an interface for managing the ACL's, ARO's and ACO's ARO's and ACO's where pretty easy to build using the tree behavior. ACL how ever got me a little messed up... especially when it came to defining the model relations. I've named my aco and ar...

How to map a database query into an Object [in Java]?

I have a query that joins 5 tables. Then I fill my hand-made object with the column values that I need. What are solutions here that are wide-common to solve that problem using specific tools ? are there such tools? I'm only beginning to learn Hibernate, so my question would be: is Hibernate the right decision for this problem? Hibern...

Which ORM tools support this version of Queryable.Select extension method

Do you know an ORM supporting this extension method: public static IQueryable<TResult> Select<TSource, TResult>( this IQueryable<TSource> source, Expression<Func<TSource, int, TResult>> selector) Basically, it allows to add row number (index of result in sequence) to the projection. Example of its usage with IEnumerable is here. ...

Core Data not saving a relationship that has been deleted

I have a "to->many" relationship in Core Data with no inverse relationship and the delete rule set to both "Nullify" and "No action" (by that I mean I've tried both with no avail) Basically I have a MergedStation whose property subStations points to many Station objects: MergedStation.subStation -->> Station When I call [mergedStation ...

Whats the difference between JPA and JDO specifications?

I have been using Hibernate ORM, which is an implementation of the JPA specification to manage relational data. I have also heard of the JDO specification that supposed to do the same (manage relational data). What are the fundamental differences between the two? Any code samples most appreciated. How does JDO integrate with other Java ...

How to generate Doctrine models/classes that extend a custom record class

When I use Doctrine to generate classes from Yaml/db each Base class (which includes the table definition) extends the Doctrine_Record class. Since my app uses a master and (multiple) slave db servers I need to be able to make the Base classes extend my custom record class to force writes to go to the master db server (as described here...

HibernateTemplate Composite Key fetching value null

Hello All... I have one table that has composite key 'rid' and 'sid'. For that i have made following beans to map with hibernate annotations : WBList.java ============ @Entity @IdClass(WBListPK.class) public class WBList { private int rid; private int sid; private String wb; @Id @JoinColumn(name="rid") public ...

SQLAlchemy Many-to-Many Relationship on a Single Table

I have a SQLAlchemy model set up in my application that should mimic the functionality of "followers" on Twitter, ie. users have have a many-to-many relationship with eachother (both followers and following). The tables are structured as follows (sa is the sqlalchemy module): t_users = sa.Table("users", meta.metadata, sa.Column("id...

NHibernate and Modular Code

We're developing an application using Nhibernate as the data access layer. One of the things I'm struggling with is finding a way to map 2 objects to the same table. We have an object which is suited to data entry, and another which is used in more of a batch process. The table contains all the columns for the data entry and some addi...

what good orm api will work well with scala or erlang

I'm considering taking up scala programming but i'm really concerned about what will become of my ORM based applications. I currently use hibernate as my ORM and i find it a really reliable tool. I'd like to know if there's any ORM tool as efficient but written in scala, or will hibernate work seamlessly with it. i don't want to have to ...

Subsonic custom mapping of objects to tables

Geeting, I'm using Compact Framework 3.5 and have tenatively settled on a custom build of Subsonic 3.0 to do data access. The trouble is that I am used to developing model-first but am also interested in keeping control of my DB schema. Therefore, neither ActiveRecord or Repository appears to meet my needs, and I want to use my existing...

Php Orm with database from model

Hi, I'm pretty used to Django. With Django you define your models for the ORM and it takes care of generating / altering the database itself for storing the data based on the models. In php i'm looking for a similar solution. Doctrine seems to be the standard php ORM, but, as far as I've seen, you have to write the DB and then attach t...

ORM library for automatically mapping foreign keys in Python or Ruby

A frequent task I run into at work is writing scripts against pre-existing databases. Sometimes I'm connecting to Oracle, other times it might be MySql or even sql server. What I would like is a tool which would reverse-engineer the database's tables and foreign keys and allow me to write OO-style scripts against the database. This coul...

Why is SQLAlchemy/associationproxy duplicating my tags?

I'm trying to use association proxy for tags, in a very similar scenario to the example in the docs. Here is a subset of my schema (it's a blog), using declarative: class Tag(Base): __tablename__ = 'tags' id = Column(Integer, primary_key=True) tag = Column(Unicode(255), unique=True, nullable=False) clas...