orm

Is NHibernate.Spatial compatible with NHibernate 3.0?

I want to use NHibernate.Spatial. I also want to use new NHibernate 3.0 features such as the improved LINQ provider and the QueryOver functionality, which are only available in NHibernate's source control trunk. Are these two things compatible? I can't work without Spatial but I really want the LINQ features, which will have to go if th...

Where clause in Fluent NHibernate Many-to-Many

I am trying to setup a many-to-many mapping in Fluent Nhibernate that has a where clause attached to the child table. This is basically how it should work: HasManyToMany(p => p.Images) .Table("ProductImages") .ParentKeyColumn("ProductID") .ChildKeyColumn("ImageID") .Where("ImageTypeID = 2"); The ImageTypeID column is in the I...

Select users with a certain role in Kohana's auth module

In the auth module, we have users and roles with a many to many relationship. My question probably has a simple answer, but I couldn't find it by myself... How would I go about selecting only users having a certain role using ORM? What I'd like to do is something like this: ORM::factory('user')->with('roles')->where('role','member')->f...

How to temporarily disable read-only 2nd level cache hibernate strategy in Grails ?

In my grails application, some of my domain classes will never be changed by Users. However, some maintenance work is sometimes necessary, and administrator should be able to create/edit few instances from time to time (let's say twice a year). I would like to set a read-only 2nd level cache strategy for these domain classes (static ma...

Apply native SQL where clause to Nhibernate query for entity

I have this problem. I have a module (module 1) that use Nhibernate to manage entity persistence; this module interacs with an other module (module 2). The "module 2" allows to generate dynamically native SQL where clause. Now I would use it to manage filter operation in "module 1". Which is the bast way to do it? Is possible get the...

Django SELECT (1) AS [a] FROM [my_table] WHERE ([my_table].[id] = ? AND NOT ([my_table].[id] = ? )) (1, 1)

Why is Django executing statements such as this: SELECT (1) AS [a] FROM [my_table] WHERE ([my_table].[id] = ? AND NOT ([my_table].[id] = ? )) (1, 1) This happens when calling is_valid() on a formset created the following way: MyFormSet = modelformset_factory(Table, fields=['my_field'], extra=0) my_form_set = MyFormSet(request.POST...

Synchronization between hibernate running locally and on a server

Is there an easy way using a library to facilitate the synchronization of two hibernate instances. One running locally on a client and one running on a central server exposed via a web service. So Client tracks changes it makes, pushes them to the Server. The server ensures that the clients is not updating out of sync objects and stores...

OutOfMemory when reading big amounts of data using hibernate.

I need to export big amount of data from database. Here is classes that represents my data: public class Product{ ... @OneToMany @JoinColumn(name = "product_id") @Cascade({SAVE_UPDATE, DELETE_ORPHAN}) List<ProductHtmlSource> htmlSources = new ArrayList<ProductHtmlSource>(); ... } ProductHtmlSource - contains big s...

How to do fulltext search with doctrine?

WHERE column = value ->add(column, value); WHERE column <> value ->add(column, value, Criteria::NOT_EQUAL); Other Comparison Operators > , < Criteria::GREATER_THAN, Criteria::LESS_THAN >=, <= Criteria::GREATER_EQUAL, Criteria::LESS_EQUAL IS NULL, IS NOT NULL Criteria::ISNULL, Criteria::ISNOTNULL LIKE, ILIKE Criteria::LIK...

in NHibernate, map 4 similar columns to list<string>

In my legacy database, I've got a table [Templates] with four columns for the "special instructions" on a shipment: .....|Spx_1|Spx_2|Spx_3|Spx_4|.... .....| | | | |..... I want to map this to a List in my class: public class Template { .. public virtual List<string> SpecialInstructions { get; ...

Does any .NET ORM support localized entities out-of-the-box ?

I need to store localized entities in a database (for instance a Product, which has a Name, which is different in English and Danish). There are several well-known ways to do this, for instance having some sort of a resource table containing the values of the localized columns. However, this does not seem to be very easy to fit into an ...

Saving and Retrieving Entities of different types using LINQtoSQL

Disclaimer: Bit of a C# newbie - first Software Dev gig in awhile after being in QA for a couple years. I realize flavors of this question have been asked before (inheritance in LINQtoSQL and the like), but I'm hoping I ask the question differently. In my database, I will have a super-type of "Event" and multiple sub-types: Conferenc...

Fluent NHibernate Many-to-One Join on a Substring

I'm trying to map 2 tables together in Fluent Nhibernate, but the only way to join them is based on using the LEFT function on one of the columns. So a SQL join would look like this: select * from TableA INNER JOIN TableB ON LEFT(TableA.ColA, 12) = TableB.ColB Is there any way to map this in NHibernate? ...

how to configure hibernate 3.3 in eclipse galileo?

i am working on galileo but i am not able to find the plugin for hibernate 3.3 can anybody send me the plugin link please. it's urgent. and also send me the spring 2.x latest version plugin also. Thanks in advance, Bhuvan Yadav. ...

Relation many-to-many with attributes : how ?

Hi, Excuse me for my poor english in advance as it is not my mother tongue. Like in this example: http://www.xylax.net/hibernate/manytomany.html But i have in the table foo-bar 2 attributes which are not part of the primary or foreign keys.: one boolean(A) & one string(B). I know how to map it without attributes but not in this case. ...

Properly Implementing a One to Many Unidirectional Relationship in Hibernate

I'm trying to learn how to use Hibernate to implement Java Object Persistence. Specifically, I'm trying to figure out how to implement a unidirectional one to many mapping. I've read the hibernate documentation and the numerous Stackoverflow questions on the subject and they are not entirely clear, so I'd like to know what the correct ...

Representing incomplete objects when loading from database

So in a recent project (a small internal tool), I want to experiment with not using an ORM tool which we typically use in all our projects. The reason is that I particularly aren't a fan of them specially in complex projects with complex object hierarchies and relationships. Using an ORM it becomes difficult to debug performance issues a...

Doctrine 2 Validations

Hello fellow PHPers! It does not seem like Doctrine 2 has built-in validation. Is this a feature that will be supported in the future? How and where do you validate your Doctrine 2 entities? Guess I have to write my own validation engine for Doctrine. thanks ...

Grails Domain Class Dynamic List As A property

Let's say I have a domain class called ShopCategoryPageTab. And I have a domain class called Product. I want ShopCategoryPageTab to have a list of Products. However, this list is not static, but determined by a formula. For example, I might want to have a "products" property which would list all products with criteria X, Y Z. So this...

ORM - Does the Database Schema Drive the Entity Composition or Vice-Versa?

We've had quite a bit of discussion among our development group concerning whether the composition of entities should drive the database design, or should the database design drive the composition of the entities. For those who have dealt with this, what has been your philosophy? Of course, not every entity maps 1:1 to a database table....