orm

Are Hibernate and RDLC alternatives to each other?

I know Hibernate is an ORM, I'm not familiar with RDLC, is it an ORM as well? If they are both ORMs wouldn't it make sense for an application team to choose to use one rather than the other during development (as opposed to using both)? ...

Retrieving ORM properties with SQLAlchemy

I have three tables (users, articles, and tags) defined in SQLAlchemy and mapped with orm.mapper(). As you can see below, I'm adding a property "author" to each article which ties that article to the user that created it. orm.mapper(User, t_users) orm.mapper(Tag, t_tags) orm.mapper(Article, t_articles, properties={ 'author' : orm.r...

How to load a one-to-many relationship in Data Mapper?

While I'll go for the Ghost pattern in a 1:1 relationship, I'm not sure if this is sufficient in a 1:n relationship. For example, when I load an Order object that may have a hundred Item objects, I would first assign NULL to the items property. The question is: A) Should I assign NULL and then, upon first access of the items property...

Should a Finder Method be part of the Data Mapper, or part of the domain class?

In Martin Fowler's Patterns for Enterprise Application Architectures book (page 229 in German, Lazy Load) he gives an example with this code: public List getProducts() { if (products == null) products = Product.findForSupplier(getID()); return products; } like you can see, the finder method seems to be part of the domain class...

Doctrine issues when using JOIN and WHERE

Hello all, I have a simple doctrine code: $dql = Doctrine_Query::create() ->select('u.ident, u.username, u.email') ->from('Users u, u.Attributes ua'); if ($query) { $dql->where('u.username LIKE ?', "%$query%") ->orWhere('u.name LIKE ?', "%$query%") ->orWhere('u.email LIKE ?', "%$query%"); } $dql->offset($start...

How long should a DataContext live?

Hi, I was just wondering how long should a DataContext really live. All the patterns and practices books like Dino Esposito's Microsoft .NET: Architecting Applications for the Enterprise tell you, datacontext must not live long, nor should it be cached. But how long is the right time? A whole web request, a unit of work, a transaction, ...

Testing custom ORM solution performance overhead - how to?

I have created a prototype of a custom ORM tool using aspect oriented programming (PostSHarp) and achieving persistence ignorance (before compile-time). Now I tried to find out how much overhead does it introduce compared to using pure DataReader and ADO.NET. I made a test case - insert, read, delete data (about 1000 records) in MS SQL S...

SOLID DDD ORM request (to use clean entities and repositories) for .NET

Is there a ORM that would leave my entities classes clean, withouth any attributes for properties and classes would not be ActiveRecord pattern so it should not have entity.Save/Delete etc. optional: able to execute stored procedures and parse the result into entityies ...

UNION query with Propel ORM

I'm trying to create a UNION query using the Propel ORM e.g $criterion1 UNION $criterion2 anyone knows how to do this? ...

SQLAlchemy Custom Type Which Contains Multiple Columns

I would like to represent a datatype as a single column in my model, but really the data will be stored in multiple columns in the database. I cannot find any good resources on how to do this in SQLAlchemy. I would like my model to look like this(this is a simplified example using geometry instead of my real problem which is harder to ...

Suggestion for annotation only ORM framework (Java)

I'm working on a medium-sized project in Java (GWT to be precise), and I'm still in the process of deciding what ORM to use. I just refuse to write SQL queries unless utterly and completely necessary (not the case :D) I want to use ONLY annotations, no XML configuring [except database location, username, etc], and I DON'T want to create...

Hiding the fact a class is an Active Record

I'm using Castle ActiveRecord, but wrapping it in my own persistence layer, because I want to hide this fact from application code. However, my entities all inherit from ActiveRecordBase<T>, so my choice of ORM is leaking to the application. What I especially don't like is the slew of methods this exposes off my entities. How can I use ...

Netbeans creating "JPA Controller classes from entity classes"

Hello, I want to achieve basic CRUD operations available of the db schema I already have for a JAVA program. To put it in another way, I have a DB schema I use with PHP and I just need them to be entities available in a JAVA application. I discovered I can use Netbeans and sucessfully created Entities from DB! (Entities look like this...

Session class in NetBeans IDE6.7

can we use Session class in Netbeans IDE 6.7.do we have to include any package for it.also if anybody can provide a sample example related to this question. ...

Nhibernate Cascade

What does Cascade in Nhibernate mean? I see a lot of options in cascading: Delete All AllDeleteOrphan DeleteOrphan SaveUpdate Can you explain these with with examples and their distinctions? ...

How do I use the guid.comb strategy in a MySql db.

Is it possible to use the guid.comb strategy for identity generation with Mysql Db using Nhibernate? When I use it as mapping.Id(x => x.Id) .Column("row_guid") .CustomType(typeof(string)) .GeneratedBy.GuidComb() .Length(36); I end up with a ----> System.InvalidOperationException : Identi...

Looking a lightweight PHP ORM

At first I was going to use doctrine ORM as the main one but it was an overkill, unneeded features and probably excessive calls. One of the main reasons was the "helper" that handled traverse trees (the hierarchy tree) easily but I'm starting to prefer building my own class. This is what I'm looking for: 1) Can manage multiple databa...

What is the best and fast ORM to use with Oracle for .NET ?

What is the best and fast ORM to use with Oracle for .NET ? Based on your evaluation , experience etc. (to replace my existing data layer for oracle) fast = operations per second best = lest time to learn and does not have any high fi mumbo jumbo Need to load 10,000 or more records and update them in 10 mins or less... on oracle. ...

Doing an atomic update of the first instance in a QuerySet

I'm working on a system which has to handle a number of race-conditions when serving jobs to a number of worker-machines. The clients would query the system for jobs with status='0' (ToDo), then, in an atomic way, update the 'oldest' row with status='1' (Locked) and retrieve the id for that row (for updating the job with worker informat...

How to implement One-to-Many mapping when the associative table is one for all one-many relationships?

General case: first table represents one-side, second table represents many-side. Third table serves as a link between the two. My case: first and second tables are the same. Third table serves as a link between all pairs of tables which have one-to-many relationship. This third table has additional field (String) which contains inform...