orm

Hibernate mapping and inheritance issues with @SecondaryTable

I have a pretty simple class hierarchy structure that is listed below, each sub class having a @DiscriminatorValue enumeration type, which works very well. Abstract class: AbstractNode (abstract class mapped to the Node table) Subclassed classes: FieldNode (simple class mapped to Node table as well, but with different @DiscriminatorV...

Running MSTest with tests against different databases

Hello guys, I would like to ask what is the best way to execute a setup like the following: We have tests suite that is compiled, and in the app.config file I have 6-7 different connection strings to different databases. I would like to run the tests suite against every connection, and I hoped to parametrize in some way this process - so...

ORM classes with collections; trying to maintain focus on parent class rather than children.

Let's say I have a Farmer class, and a Farmer has a collection of Pigs. If I use an ORM like Hibernate, I can cascade updates to a Farmer's Pig collection, such that I can do something like this from my controller: Pig pig = new Pig("Charlie"); farmer.addPig(pig); farmerService.save(farmer); My farmer service doesn't know anything ab...

Problems eagerloading a set of object using SQLAlchemy

I'm using Turbogears2 and SQLAlchemy to develop a webapp. I have two mapped tables O1 and O2. O2 has a sorted list of O1s in 'ones'. At some point I want to query all O2's and the referenced O1's. Unfortunately the query below fails because table O2 is aliased in the query and the column referenced by the order_by phrase is no longer kn...

Reasons for not using an ORM

Duplicate: Are there good reasons not to use an ORM? We have all heard the reasons for using an orm. What are your reasons for NOT using an ORM? I am an ORM believer, but as a consultant I find that ORM usage is actually very low -- which is strange to me. Many shops refuse to use them, and actively tell their employees not to...

eclipse default jpa implentation library where to download?

In eclipse, the "default implementation library" what jars files do I need to include if I do not want to use server runtime? I'm refering to this tutorial http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.jpt.doc.user/task_create_new_project.htm ...

Detached Objects in Jdo/Hibernate - What are they for anyway?

Can some explain to me what is the advantage of using detached objects within the context of a web application? AFAIK they are only useful if the objects somehow outlive the "lexical" scope of the transaction, but typically in a web app when your transaction is over you just send your objects to the view layer, and they will not be reatt...

ORM with good support for long running context

Related question here. With most ORMs when you run a query against an existing context it does not return data that has been changed since the objects were first returned from the database. It issues the query to the DB but any changes made to the DB aren't returned because the context doesn't want to stomp on your objects (for a discu...

How do I restore a transient field in Hibernate like readResolve() for hibernate serialization?

Is there a way to hook up a callback method to be called when an object is deserialized from Hibernate. Similiar to Java's readResolve() method for Java object serialization? ...

Is there an ORM that can dynamically generate a DAL from within a .Net WinForms app?

I'd greatly appreciate your advice on a strange specification. We have a requirement to create an application where users can drag/drop field types onto a form so that they can create their own "app". I have the front-end setup, but the back-end is a big problem. There are forward mapping ORMs and reverse mapping ORMs, yet I've not ...

What do they mean by persistence in nHibernate?

Hi, What does the term persistence mean when dealing with nHibernate? What exactly is persistent? ...

Manual DAL & BLL vs. ORM

Which approach is better: 1) to use a third-party ORM system or 2) manually write DAL and BLL code to work with the database? 1) In one of our projects, we decided using the DevExpress XPO ORM system, and we ran across lots of slight problems that wasted a lot of our time. Amd still from time to time we encounter problems and exceptions...

Can Hibernate work with MySQL's "ON DUPLICATE KEY UPDATE" syntax?

MySQL supports an "INSERT ... ON DUPLICATE KEY UPDATE ..." syntax that allows you to "blindly" insert into the database, and fall back to updating the existing record if one exists. This is helpful when you want quick transaction isolation and the values you want to update to depend on values already in the database. As a contrived exa...

ASP.NET and Entity Framework in Layered Architecture - using Entity Framework for ORM only

I have an ASP.NET application that uses a layered architecture e.g. presentation layer, business logic layer, data access layer. I don't want to the business layer to have to know anything about how the data access layer is implemented and I'm not looking to bind the Entity's directly to a data control using the EntityDataSource or anyt...

What is the difference between llblgen and nHibernate?

What are the key differences between llblgen and nHibernate? ...

SubSonic - AllStruct.cs looks wrong

Using SubSonic 2.2, after DAL generation with sonic.exe, the AllStruct.cs content looks wrong: // <auto-generated /> namespace ...DAL { #region Tables Struct public partial struct Tables { ... } #endregion #region Schemas public partial class Schemas { ... } #endregion #region View Struct public partia...

ORM frameworks

I need to collect some information about existing ORM solutions. Please feel free to write about any programming language. Can you tell about the best ORM framework you ever use and why is it better then others? ...

Fluent NHibernate FluentMappings.AddFromAssemblyOf<> Issue

A coworker and I were recently doing the backend for a small application using Fluent NHibernate. We wrote our entities, mapping files, persistence manager, but for some reason we couldn't export the database schema to anything. Through the debugger we discovered that the FluentMappings.AddFromAssemblyOf was returning 0 mappings, even t...

Code-First or Database-First, how to choose?

Let us suppose we are going to start new project - application that contains some business logic, user interface on ASP.NET, WPF or both of them. We'd like to use ORM or DAL code generator and implement our business logic in .NET classes. There are several fundamental ways how we can express our ideas of business domain: Implement busi...

Hibernate second-level cache in orm.xml?

Hello, Having been googling for hours, I realize that users can use either xml file(orm.xml, I suppose?) or annotations in JPA, or both of them at the same time. I'm i correct? So, My project use the second-level cache, which is not in the JPA specification. And I use annotations like: @org.hibernate.annotations.Cache(usage = org.hibern...