orm

How to set an FK column value without retrieve it

Hi, i want to set a new value to my entity objects FK column, but i cant find the property to set. I dont want to get record from db. I have a db like that Db Tables: Concept ConceptType -Id (PK) -Id(PK) -Name -Name -ConceptTypeId(FK) (ALLOW NULL) Code: Concept conceptToUpdate = new Con...

DAO, ORM and Queries

There is a need to update one field to the same value in a heap of records. Using the DAO/ORM structure, I would retrieve each parent object, loop through each child object, update it's field, and then save it. It would be faster to just write the SQL: update table set field = value where criteria = specified. How do I fit these things...

Preventing NaN from being persisted by Hibernate

I am using Hibernate as my JPA provider with it connecting to a Progress database. When a NaN value is persisted it is causing lots of problems - it prevents the row from being read in certain circumstances. Is there a way to hook in to the standard double type persistence to convert NaN (and probably + and - infinity) to a different val...

NHibernate and python

Hi, We have an existing C# project based on NHibernate and WPF. I am asked to convert it to Linux and to consider other implementation like Python. But for some reason, they like NHibernate a lot and want to keep it. Do you know if it's possible to keep the NHibernate stuff and make it work with Python ? I am under the impression that...

Seqential & continuous invoice number in Hibernate / ColdFusion ORM?

One of the requirements of my billing software is that the invoice number must be sequential & continuous. (no invoice number can be skipped). I tried setting the invoice number as PK, and tried hibernate's increment & native generator, but both of them do not guarantee continuous number when a transaction fails. The next invoice will ...

has_many in Rails uses a JOIN

My understanding of the has_many relationship in Rails is that it will use a JOIN to find related rows. If I were implementing this from scratch I would have created a relational table. Am I correct in thinking it will be slower to use a JOIN? In Django, I believe the relational tables are created, and I know that I can use a relational ...

How to make Doctrine delete table prefixes from class names?

Hello, I'm using Doctrine 1.1.5 and I'd like to know if there is some option for remove table prefix from files and class names when calling Doctrine::generateModelsFromDb or Doctrine::generateModelsFromYaml. Edit: For example I have tables like mo_article, mo_language, mo_article_text, etc. When Doctrine generates the models (using th...

Hibernate, aliases

Hello! I noticed that hibernate generates different aliases for the same columns each time i try to access the same table: Hibernate: select person0_.id as id0_0_, person0_.nam as nam0_0_, person0_.fam as fam0_0_, person0_.otc as otc0_0_ from web_db.Person person0_ where person0_.id=? Hibernate: select person0_.id as id4_0_, person0_.n...

JPA primary key auto generate

my primary key entity look like below @GeneratedValue(strategy= GenerationType.TABLE) private Long id; when i run, i get error could not get or update next value;nested exception is org.hibernate.exception.SQLGrammerException:could not get or update next value but when i just change to @GeneratedValue private Long id; no error...

sqlalchemy does not create my foreign key

SqlAlchemy newbie question: Base = declarative_base() class A(Base): __tablename__ = 'as' id = Column(Integer, primary_key=True) class B(Base): __tablename__ = 'bs' id = Column(Integer, primary_key=True) a = relation(A) When I create my database schema, I have two tables, as and bs, which have one column (id) but...

Yet another Hibernate question

My application is trying to use Hibernate annotations. I've gotten the 3.5.0 version of Hibernate installed, but when I try to load my app I get the following exception: junit.framework.AssertionFailedError: Exception in constructor: testSubscriber (java.lang.NoClassDefFoundError: javax/persistence/spi/ProviderUtil at java.lang.Clas...

Doctrine ORM - Implement self-relations

Hi everyone! Can anyone give me an example of how to implement a class self-relation? Thanks in advance, Best regards! ...

Fluent NHibernate - unit-testing a one-to-many *inverse* mapping

I can't figure out how (or if it's at all possible) to use the Fluent NHibernate PersistenceSpecification<T>.CheckList(...) method to check an inverse one-to-many mapping. Here's what I'm trying to do: Using fluent nhibernate on a vanilla blog/post example, I have defined a one-to-many blog<->posts mapping. One restriction I want is th...

Use LINQ generated classes directly?

LINQ will generate a set of classes from the SQL files. Should these be used directly, or should they be wrapped in another class so the model is not so dependent on the implementation? ...

Doctrine Load Module Exception

Hello all, I'm new to doctrine. I created an bootstrap file like the following one: require_once(dirname(__FILE__)."/../conf/general.php"); require_once(dirname(__FILE__).'/Doctrine/lib/Doctrine.php'); spl_autoload_register(array('Doctrine', 'autoload')); $manager = Doctrine_Manager::getInstance(); $manager->setAttribute(Doctrine::AT...

Doctrine ORM JOINS

I have a few simple classes, all extending Doctrine_Record. Now I want to make a slightly more complex query with Inner Join, not just table data extracting. I am doing to use DQL, does this oblige me to manually define relation between 2 tables? Should I define this relation class or I better update schema.yml and somehow re-generate...

Is there any good ORM for VistaDB?

Hi I'm looking for a good ORM for VistaDB database. It's for an small desktop application and it might expand in future. Open source solution will be preferred, but I'm ready to shell out if required. Regards, Vikas ...

3-tiered web-service enabled architecture

Dear All! After reading tons of articles over the net about best-practise application-design and pattern I still cannot merge all the information together and map on my real-word-application... I would like to have a 3-tiered application: UI-Layer:A silverlight-application hosted within an ASP.net - Webapp BusinessLogicLayer:WCF-Serv...

Many-to-many on the same table with additional columns

I have a class User. A user can be a friend with many other users. The relationship is mutual. If A is a friend of B then B is a friend of A. Also I want every relation to store additional data - for example the date when two users became friends. So this is a many-to-many relationship on the same table with additional columns. I know th...

Spring JDBC RowMapper with Class Hiearchies

I wanted to know what the community considers the "best practices" in respect to mapping class hierarchies with Spring JDBC. We do not have the ability to use a full fledged ORM tool, however we are using the Spring JDBC to alleviate some of the tedious nature of JDBC. One class which we leverage very regularly are the BeanPropertyRo...