orm

Copying persistent data across db sessions/units of work

I use DevExpress' XPO ORM, but I suspect that this applies to many other ORMs and this happens to me all of the time and it's starting to get annoying. The situation is: 1 form with a UnitOfWork used to populate user controls etc. with data from the db. (eg. a user settings form) a dialog window with a UnitOfWork used to populate user...

Database Structure for CakePHP Models

We're building a data tracking web app using CakePHP, and I'm having some issues getting the database structure right. We have Companies that haveMany Sites. Sites haveMany DataSamples. Tags haveAndBelongToMany Sites. That is all set up fine. The problem is "ranking" the sites within tags. We need to store it in the database as an archi...

how can i use ORM tool like My Generation?

i downloaded MyGeneration from net. And run. it has got connection string. "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Data Source=localhost " on the other hand; my connection string : Data Source=.\sqlexpress; Initial Catalog=NetTanitimTest; Integrated Security=True if i click save or connect button it throws to me co...

Extended properties with Entity Framework or NHibernate

Hello, everyone! Is there are an easy way to store some of entitie's properties in a column as a bulk, as XML or something? Querieng by those properties of course is not an option, but it still'd be valuble to be able to extend data model without database migration. ...

How to I create an HQL query to return objects in a many to many relationship?

Hi there. I have an application that includes 2 classes Club and Article. These are mapped in Hibernate as a many to many relationship. As a result, hibernate has created a table called CLUB_ARTICLE which it uses to manage the many to many relation ship. The CLUB and ARTILCE tables have no direct reference to each other and the mapping ...

How to recover data from a table, and store that into list?

How can I get ALL the data from a table of my DB (mySQL) using hibernate, and store the output into List of Objects? I'll use this List, to populate a JTable. ...

ORM for PHP - performance problem

What do you think, should I use ORM like Propel or Doctrine? For a new PHP Project. Are there any performance issues? ...

rails: has_many :through validation?

Rails 2.1.0 (Cannot upgrade for now due to several constraints) I am trying to achieve this. Any hints? A project has many users through join model A user has many projects through join model Admin class inherits User class. It also has some Admin specific stuff. Admin like inheritance for Supervisor and Operator Project has one Admin,...

hibernate bulkupdate: update query syntax

when i update a table using hibernate getHibernateTemplate().bulkUpdate("UPDATE Channel SET number = 40 AND active = 0"); i get error: ERROR [PARSER]: unexpected token: AND evething run well if i remove AND active = 0 i dont know how to correct this query. help me pls, thanks :) ...

Connecting to MS sql through hibernate

I want to connect to MS SQl server 2005 using hibernate in java. i am unable to find the jars and the hibernate.cfg.xml file for the same. can someone help me with the same ...

SQL Schema to Hibernate Class

Hi, I got an existing table in Oracle database how can I generate my Hibernate Java class etc from this table? Using Eclipse 3.2, Java 5 ...

Can't figure out a one-to-many bidirectional association with join table

I'm trying to figure out this mapping, and somehow it's just eluding me. It's irritating, because it seems like it should be a common case. I have a basic Parent and Child class with a join table between them. The Child class is dependent on the Parent: if an Child is removed from the Parent, the Child ought to be deleted as well. The H...

Self referencing symmetrical Hibernate Map Table using @ManyToMany

I have the following class public class ElementBean { private String link; private Set<ElementBean> connections; } I need to create a map table where elements are mapped to each other in a many-to-many symmetrical relationship. @ManyToMany(targetEntity=ElementBean.class) @JoinTable( name="element_elements", joinColumns=@Jo...

hibernate foreign key mapping many-to-one

I have been working on it for quite a while, but still can't figure out what's wrong with my code. Each Service has multiple profiles, but each profile only has one Service. Service { Long service_id; // primary key ... getter/setter } Profile { Long profile_id; // primary key Long service_id; // foreign key ... getter and setter } i...

How to map IEnumerable<SelectListItem> to IList<> for ListBox

I have two classes. Class1 and Class2. public class Class1{ ... public virtual IList<Class2> Class2s{get;set;} ... } public class Class2{ ... public virtual IList<Class1> Class1s{get;set;} ... } The view contains <%=Html.ListBox("Class2s", ViewData.Model.Class2s.Select( ...

PHP ORM library based on the Data Mapper pattern

For a PHP application with a complex domain model, I don't want to use the Active Record pattern, I need instead the Data Mapper pattern (as presented in Zend Framework). Do you know any library that could help me for the ORM part, or else a link to a documentation on "how to do it right" ? Thanks ...

IQueryable pipline, with inheriting ORM model

I am trying to implement a media library system, and I started out my design from the POCO. I am planning to decouple the actual data access from the object so that, I may persists the same object in XML or SQL. What I have in the design is: public abstract class MediaBase {} public class Image : MediaBase {} public class Movie : Medi...

Can this be done with the ORM? - Django

Hi folks, I have a few item listed in a database, ordered through Reddit's algorithm. This is it: def reddit_ranking(post): t = time.mktime(post.created_on.timetuple()) - 1134000000 x = post.score if x>0: y=1 elif x==0: y=-0 else: y=-1 if x<0: z=1 else: z=x return (log(z) + y * t/45000) I'm wonde...

Access with Silverlight to a postgres database running under Linux ?

Hi everyone, I know we cannot access directly to a database with Silverlight. Linq 2 SQL doesn't exist for Silverlight but can I use other things ? I heard too about RIA Services and ADO.net but I don't think they are implemented for a Linux Server. Thanks for your future answers. ...

Method for defining simultaneous has-many and has-one associations between two models in CakePHP?

One thing with which I have long had problems, within the CakePHP framework, is defining simultaneous hasOne and hasMany relationships between two models. For example: BlogEntry hasMany Comment BlogEntry hasOne MostRecentComment (where MostRecentComment is the Comment with the most recent created field) Defining these relationships in...