orm

What would you pick for your ASP.NET webapp; nHibernate, Linq, or SubSonic

Something else perhaps? I am already using nHibernate, but I get occasional issues where a lazy initialized proxy object won't actually initialize. I'm thinking of trying something else. The site has user accounts, user posts and photos, and filtering of those to certain location names and title/description matches. Not to mention voting...

Problem using SQLite :memory: with NHibernate

I use NHibernate for my dataacess, and for awhile not I've been using SQLite for local integration tests. I've been using a file, but I thought I would out the :memory: option. When I fire up any of the integration tests, the database seems to be created (NHibernate spits out the table creation sql) but interfacting with the database c...

Are there good reasons not to use an ORM?

During my apprenticeship, I have used NHibernate for some smaller projects which I mostly coded and designed on my own. Now, before starting some bigger project, the discussion arose how to design data access and whether or not to use an ORM layer. As I am still in my apprenticeship and still consider myself a beginner in enterprise prog...

Kohana PHP, ORM and MySQL BLOBs

I'm trying to create and retrieve a BLOB in a MySQL table via Kohana's ORM library. The code looks something like: $attachment = new Attachment_Model(); $attachment->name = $info['FileName']; $attachment->size = strlen($info['Data']); $attachment->data = $info['Data']; $attachment->mime_type = $info['content-type']; $attachment->save()...

Opinions wanted: is it better to connect, or disconnect, the entities in the domain model?

I'm starting a new project; I wish to follow a DDD approach. We have talked to the business and achieved some insight into the domain in some detail (internet TV). The team is five strong and distributed. We have adopted the repository pattern for data-access. We are following a service-based approach overall; services are responsibl...

Best practice to realize a long-term history-mode for a O/RM system(Hibernate)?

I have mapped several java classes like Customer, Assessment, Rating, ... to a database with Hibernate. Now i am thinking about a history-mode for all changes to the persistent data. The application is a web application. In case of deleting (or editing) data another user should have the possibility to see the changes and undo it. Since ...

Best free ORM tools to use with .NET 2.0/3.5

I'm interested in using an Object-Relational Mapping package for an upcoming project. This project will begin as an ASP.NET application but will have lots of functionality that will eventually be shared with WinForms applications. Can anyone suggest some good, free ORM packages that work well in both ASP.NET and WinForms situations? ...

ORM for Database with 1000+ Tables

I'm looking for a solid ORM for .NET that can handle over a 1000 tables and entities. What can you suggest? Any comments would be appreciated, but those from people who have actually dealt with this challenge and a description of how with what they dealt with it would be appreciated even more. ...

NHibernate custom SQL object creation

Somewhat-simplified example situation: I have entities A and B which are incredibly "heavy" domain objects. Loading one from the database is a pretty big deal. Then I have an entity C, which is a very simple object that has a label string, one A, and one B -- both lazy. I'm doing some low-level querying to create huge lists of C, so I k...

How to use Hibernate @Any-related annotations?

Could someone explain to me how Any-related annotations (@Any, @AnyMetaDef, @AnyMetaDefs and @ManyToAny) work in practice. I have a hard time finding any useful documentation (JavaDoc alone isn't very helpful) about these. I have thus far gathered that they somehow enable referencing to abstract and extended classes. If this is the case...

ORM support for compound primary keys

I've read that compound primary keys will confuse the hell out of typical ORM code generators. Which ORMs work best with compound PKs and which to avoid? (I've a particular interest in .NET) ...

Is Functional to Relational mapping easier than Object to Relational?

Object-relational mapping has been well discussed, including on here. I have experience with a few approaches and the pitfalls and compromises. True resolution seems like it requires changes to the OO or relational models themselves. If using a functional language, does the same problem present itself? It seems to me that these too p...

Mapping multiple Values to a Value Object in NHibernate

Hi, i'm fairly new to NHibernate and although I'm finding tons of infos on NHibernate mapping on the web, I am too silly to find this piece of information. So the problem is, i've got the following Model: this is how I'd like it to look. One clean person that has two Address Properties. In the database I'd like to persist this in ...

C# class from a SQL database table.

Came across this: http://www.eggheadcafe.com/articles/adonet_source_code_generator.asp And wondering if this is the right solution as I am not that big of a fan of creating a class for every stored procedure or do I use Enterprise Library for ASP.net 2.0 project. ...

What is the easiest to use ORM framework for PHP?

I'm looking for Ruby's Active record for PHP. Something that is so simple that I just define my fields, extend the base ORM class, and I get ACID operations for free. I should get default getters and setters without writing any code, but overriding a default getter or setter is as easy as declaring get$fieldName or set$fieldName function...

Query to get all revisions of an object graph

I'm implementing an audit log on a database, so everything has a CreatedAt and a RemovedAt column. Now I want to be able to list all revisions of an object graph but the best way I can think of for this is to use unions. I need to get every unique CreatedAt and RemovedAt id. If I'm getting a list of countries with provinces the union lo...

Is it possible to install Kohana libraries for ORM in PHP without using the entire framework?

In a previous question, I asked about various ORM libraries. It turns out Kohana looks very clean yet functional for the purposes of ORM. I already have an MVC framework that I am working in though. If I don't want to run it as a framework, what is the right fileset to include to just give me the DB and ORM base class files? Update: I ...

Creating a custom Hibernate UserType - What does isMutable() mean?

I am creating a custom UserType in Hibernate for a project. It has been relatively straightforward until I came to the isMutable method. I am trying to figure out what this method means, contract-wise. Does it mean the class I am creating the UserType for is immutable or does it mean the object that holds a reference to an instance of ...

What's the best way to copy and insert data from related tables into a new set of related tables with Linq

I work on a web game , I use asp.net mvc, linqtosql. I have 3 tables that store default game values: DefaultRegions, DefaultSubRegions and DefaultCountries. These 3 tables are related to each other thanks to primary / foreign keys. I need to copy the values of these tables into 3 tables called Regions, SubRegions and Countries when som...

Effort Spent on Designing, Implementing and Maintaining CRUD.

Hi, What percentage of your total development effort do you spend on implementing and maintaining simple Create, Read, Update and Delete (CRUD) methods in your data access layer? Does moving to an ORM like Hibernate or Entity Framework lead to significant savings? Are there any design smells which let you know when moving to an ORM for...