orm

Hibernate mapping for situation, where the the key is also used as many-to-one parameter

I was wondering if there is a way to do Hibernate mapping for the following. My two days spent on this say there isn't. There are two tables, having one to many relationship. +---------------------+ +-----------------+ | versioned_entity | | basic_entity | +---------------------+ +-----------------+ | fk_BasicEn...

Which ldap object mapper for python can you recommend?

I have to synchronize two different LDAP servers with different schemas. To make my life easier I'm searching for an object mapper for python like SQLobject/SQLAlchemy, but for LDAP. I found the following packages via pypi and google that might provide such functionality: pumpkin 0.1.0-beta1: Pumpkin is LDAP ORM (without R) for python....

kohana transaction with orm

is it possible (how) to use mysql transactions and rollbacks using kohana ORM ? ...

Execute "MEMBER OF" query against 'ElementCollection' Map fields in JP-QL (JPA 2.0)

Is it possible to run a "MEMBER OF" query against associative arrays? If so, what does the syntax look like? The obvious workaround is a native query but that gets pretty messy what with all the joins and such. I'd like to test for existence of an object within the map's key set, value collection or entry set. Maybe something like th...

Ruby - Working with Mechanize::File response without saving to disk

Hi all, I'm working on my first ORM project and am using Mechanize. Here's the situation: I'm downloading a zip file from my website into a Mechanize::File object. Inside the zip is a file buried three folders deep (folder_1/folder_2/file.txt). I'd like to pull file.txt out of the zip file and return that instead of the zip file itse...

in .net what class(s) should I use to make working with data from DB easy (not including Entity Framework or LINQ)

Hi, QUESTION 1 - What .NET classes should I be looking at to help me read / update some data in a database, but assuming I'm not using LINQ or Entity Framework. That is if you drop back to the core .net framework what are the key classes to use. In particular something that lets me access data from table X via use of C#/object type ...

Complex ordering in Django

I have a Django model for Cat which has a foreign key Dog. The Dog model has a date key timestamp. I want to order the cats, using Cat.objects.order_by, according to the timestamps of their respective dogs. How do I do that? ...

How do you check if a table exists with NHibernate(or Fluent)?

Whats the best, most consistent way to check if a table exists in NHibernate (or with Fluent-Nhibernate)? Is it even possible? I mean it seems like a simple task for such a heavy-duty ORM. Also on a related question, can you check if a set of tables or a whole schema exists with NHibernate? ...

Unit testing Linq 2 Sql lazy-loaded properties

Lets say I have a Customers table and an Orders table with a one-to-many association (one customer can have multiple orders). If I have some code that I wish to unit test that accesses a specific customer's orders via lazy-loading (e.g. a call to customer.Orders), how do I mock / stub that call out so that it doesn't hit the database? ...

best way to map linq2sql objects to entities

I have been doing this: public List<Role> GetRoles() { List<Role> result = new List<Role>(); foreach (var r in Db.tblRoles) { result.Add(new Role() { Description = r.d, Id = r.Id, Responsibility = r.Responsibility });...

Inserting two related objects fail in SQLAlchemy

Hi Community, I'm getting the (probably trivial) error, but completely clueless about the possible causes. I want to insert two object in the DB using SQLAlchemy. Those objects are related, here are the declarations. Class User: class User(Base): __tablename__ = 'cp_user' id = Column(Integer, Sequence('id_seq'), primary_key=Tr...

doctrine orm: bypass lazy loading and prefetch related records in a getter

Working with Doctrine ORM, is it possible to enable auto eager loading of related records when using in a getter ? (without explicit leftJoins()) I know I can use a leftJoin() to obtain the object with related records, but I want to avoid creating a DQL query for every object and simply have some kind of automatic "prefetching" of rela...

ORM Technologies vs JDBC ?

Hi, My question is regarding ORM and JDBC technologies, on what criteria would you decide to go for an ORM technology as compared to JDBC and other way round ? Thanks. ...

What ORM frameworks for .NET and Oracle Do You Like Best?

What ORM frameworks for .NET and Oracle Do You Like Best? ...

Fluent NHibernate: mapping one-to-one

NHibernate seems to support a special case of one to one mapping (That doesn't require a 1-m mapping on each side of the relationship). See this article by Ayende: http://nhforge.org/blogs/nhibernate/archive/2009/04/19/nhibernate-mapping-lt-one-to-one-gt.aspx I have no idea how to specify this in Fluent NHibernate though - is this pos...

Fluent NHibernate: rarely used properties as Component, or in seperate table?

Hi, I wonder if you could help me with something I've been thinking about. Say we have an Entity. Say the endtity has an ExtendedInfo object, which contains various properties which are not often used. I'm wondering how best to structure this for FNH. The easiest thing to do I suppose would just set the UserInfo up as a Fluent Nhibe...

Datetime in java and default datetime mapping in hibernate

Hello good people, I need some little help about a confusion i'm having. since i came from C# .NET i was expeting java to have something similar to C# DateTime. While i manage to create a helper method to convert string representation of date like eg "2009-10-16 11:14:34" to date object. here is the method public static Date convertT...

what is the best code generator for NHibernate?

what is the best code generator for NHibernate? ...

eliminating unnecessary database hits in django

I'd like to reduce actual database hits when working in django so I've created this artificial example to outline the problem. The model looks like this: class Car(models.Model): name = models.CharField(max_length=10) user = models.ForeignKey(User) In my view I want to do something like this: def cartest(request): cars = ...

DDD: Should everything fit into either Entity or Value Object?

Hi, I'm trying to follow DDD, or a least my limited understanding of it. I'm having trouble fitting a few things into the DDD boxes though. An example: I have a User Entity. This user Entity has a reference to a UserPreferencesInfo object - this is just a class which contains a bunch of properties regarding user preferences. These ...