orm

Sorting on Column in Type Table with ColdFusion ORM

Hi all, I have three tables, with the following structure: http://dl.dropbox.com/u/2586403/ORMIssues/TableLayout.png The three objects I'm dealing with are here: http://dl.dropbox.com/u/2586403/ORMIssues/Objects.zip I need to be able to get a PartObject, and then pull all of its Attributes, sorted by the AttributeName in the Type...

Extended Session for transactions

What is 'Extended Session Antipattern' ? ...

Can nhibernate be used without doing the XML mapping?

I have a lot of classes and this is a lot of work to do the XML mappings. ...

Wrong query generated with @OrderBy annotation

Hi, I am using Hibernate3 and i have an entity with the following collection: @ManyToMany @JoinTable(name = "buys_publishers", joinColumns=@JoinColumn(name="buy_id", referencedColumnName = "buy_id"), inverseJoinColumns=@JoinColumn(name = "publisher_id", referencedColumnName = "publisher_id")) @OrderBy("name") private List<Publi...

Problem with generated SQL from Hibernate (MS SQLServer)

Hi, I have a problem with Hibernate generating an SQL that do not work on SQLServer (works on PostgreSQL without any problems). I have tried to set the hibernate dialect for SQLServer but the same SQL is still generated and still do not work. The HQL query looks like this: select count(t) from ValidationLog t The generated SQL looks ...

ASP.NET MVC lookup tables in Linq to SQL

This really is an architectural question. I feel like I'm going about this the wrong way and wanted some input on best practices. Let's say I have a Transactions table and a TransactionTypes table. Views will submit the appropriate transaction data which is processed in my controller. The problem is that the logic in the controller may ...

Hibernate LazyInitializationException: failed to lazily initialize a collection of role

I have a web service which is essentially a wrapper for a DAO. I am calling the web service/DAO to request a collection of entities. The "parent" entity class contains a collection of "child" entity objects, i.e. a one-to-many relationship. The DAO method call which fetches the "parent" entity collection (i.e. myDAO.findAll()) retur...

how to write udpate sql in python elixir

i'm using elixir as my orm for mysql database, and it's hard for me to write a update sql under elixir "update products set price=NULL where id>100" class Product(Entity): using_options(tablename='model_product') name = Field(Unicode(200)) en_name = Field(Unicode(200)) price ...

Fatal Error when using Doctrine ORM with Zend Framework

I am having a little play with an ORM but I am struggling to get off the starting blocks. I am familiar with Zend_Db and was hoping Doctrine would work in a similar way but with more flexibility. I've followed the various tutorials, to integrate Doctrine with Zend Framework, which are available. All these tutorials more or less say the ...

JPA2 unique constraint: do I really need to flush?

Hi, I have a DAO where I need to catch an unique constraint exception. To do this, the only working solution is to flush my EntityManager after the persist. Only then I come into a catch block where I have to filter out the exception. And, my DAO method needs to be wrapped in a transaction (REQUIRES_NEW) otherwise I have the RollBackExc...

Hibernate query:Don't delete child when removing association with parent.

I am removing a Child from its association(many to one) to Parent.When i use saveOrUpdate method on Parent, Hibernate by default tries to remove Child from the Table.Is it a bug with hibernate?? How can I avoid this condition??? ...

Good comparison Doctrine vs Propel

Hi! I've seen plenty of comparisons of Doctrine vs Propel, but none of them has actually convinced me to choose Doctrine over Propel. I've been using Propel for a while now and almost every comparison I read states that Propel is not well documented as the first problem and I've read Propel's docs and they're quite well. Also, most of...

MVC + ORM, generating reports

I've just started using Zend Framework and Doctrine as its ORM, and I have some doubts regarding the model. It's obvious that the purpose of the ORM is just to map my domain model to database model, but I'm curious how you would model various reports needed on a Web application? From my point of view, and correct me if I'm wrong, I shou...

concurrency (stale data) problem in JPA

Let's say I have methods with following signature Object getData(int id) { //create a entity manager //get data frm db //return data } updateData() { Object obj = getData(id) //get entity manager //start transcation tx //update //commit tx } Now will it cause concurrency issue? Can data be stale in worst case? E.g....

How do you pull beans related by foreign keys in RedBeanPHP?

I'm using RedBean PHP ORM 1.2 with Zend and Mysql for a new project. I'm still in the process of learning it and it works very well for many scenarios, except i cant find how to load beans related by foreign keys. Allow me to explain. I have two tables; members and feeds. Each 'feed' is linked via a foreign key (in MySQL) to a member. T...

nHibernate, an n-Tier solution + request for advice

I'm getting the chance to develop a mildly complex project and have been investigating the various approaches that I can use to tackle this project. Typically I would have ran with the traditional 3-Tier approach but after spending some time looking around at various options I've got an inkling that some kind of ORM might be a better fi...

Rails 3: DataMapper instead of ActiveRecord

After all the hussle about Rails 3, can I, after all, painlessly use DataMapper without almost changing my ActiveRecord code so that I could run my Rails at GAE without any bother? ...

What are each of the template types intended usage, pros and cons?

I have not hardly touched EF4, but I've used Linq to sql quite a lot. I would like to start into one of the EF templates but I have no idea what situations make sense for each or what their intent was. I have the following possibilities: Data templates ADO.NET Entity Data Model Service-based Database (is this even related to EF? Cod...

Hibernate: How to generate Id from entity constructor parameters ?

How to generate id for entity using constructor parameters - is that possible ? I need that to make tree structure (category -> subcategories...) passing to constructor parent category id. Category category = new Category(parentId); CategoryDAO.add(category); ...

[cakephp] how to retreive all product from the db using an id's list?

Good Morning People! i have an array of products id's: $product_ids = array(10,14,15,...); and i want to find all the corresponding products on the DB using Cakephp's ORM. I'm using Mysql so the query would be something like: SELECT * FROM products WHERE id IN ( 10, 14, 15,... ) I could use the query() function, but it's seems lik...