orm

Hibernate - hibernate.hbm2ddl.auto = validate

I am interested in how hibernate.hbm2ddl.auto=validate actually works and I am struggling to find comprehensive documentation. We've recently discovered production system was affected by http://opensource.atlassian.com/projects/hibernate/browse/HHH-3532 (Hibernate matches foreign keys on name, rather than signature and so will recreate ...

PHP Doctrine ORM - How can I set the caching of data dependable on a variable

Hi, I want to use the caching from Doctrin ORM for PHP. In the model classes how Can I cache the results of the query depending on the value of a flag. I do not want to change the signature of the current methods... Is there a way to set a global variable for the Doctrine ORM and to check that doctrine variable inside the model classe...

ORM supporting immutable classes

Which ORM supports a domain model of immutable types? I would like to write classes like the following (or the Scala equivalent): class A { private final C c; //not mutable A(B b) { //init c } A doSomething(B b) { // build a new A } } The ORM has to initialized the object with the constructor. So it is possible ...

Basic Hibernate Caching Question

Does Hibernate use cache (second level or otherwise) if all I am doing is batch inserts? No entities are being requested from the database, and no generators are used. Also, would StatelessSession vs Session change the answer? What if I was using a Session with a JDBC batch size of 50? The cache I will be using is Ehcache ...

Trying to Unit Test A Class That Makes DB Queries Using Hibernate And Can't Get Session Created...

I am trying to implement JUnit tests for a class that performs DB queries using Hibernate. When I create the class under test, I get access to the session through the factory by doing the following: InitialContext context = new InitialContext(); sessionFactory = (SessionFactory) context.lookup(hibernateContext); This works fine when ...

Dump Linq-To-Sql now that Entity Framework 4.0 has been released?

The relative simplicity of Linq-To-Sql as well as all the criticism leveled at version 1 of Entity Framework (especially, the vote of no confidence) convinced me to go with Linq-To-Sql "for the time being". Now that EF 4.0 is out, I wonder if it's time to start migrating over to it. Questions: What are the pros and cons of EF 4.0 rela...

ClassNotFoundException (HqlToken) when running in WebLogic

I have a .war file for an application that normally runs fine in Jetty. I'm trying to port the application to run in WebLogic, but at startup I'm getting these exceptions: ERROR:Foo - Error in named query: findBar org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken [from Bar] at org.hibernate.hql.as...

How do I Retrieve Relative Scores From a Subset of Entities in CoreData

Hi all, Sorry for the long question but I think it needs some background :S I have the following model in CoreData: A Guest can have any number of Scores in its scores relationship. A Score can have a maximum of two Guests in its guests relationship. For each pair of Guest entities I model have a Score entity with a value indicatin...

OJB Reference Descriptor 1:0 relationship? Should I set auto-retrieve to false?

Hi, I am having an issue while using Apache OJB with Spring 2 inside my web app. I'm using OJB reference-descriptor with 2 foreign key properties. I have an object A (parent) and object B (referenced object). The thing is, for an object A, there may or may not be an object B. In the case where there is no object B to go with Object A...

HIbernate 3.5.1 - can I just drop in EHCache 2.0.1?

I'm using Hibernate 3.5.1, which comes with EHCache 1.5 bundled. If I want to use the latest EHCache release (2.0.1), is it just a matter of removing the ehcache-1.5.jar from my project, and replacing with ehcache-core-2.0.1.jar? Any issues to be aware of? Also - is a cache "region" in the Hibernate mapping file that same as a cache "...

PHP - Frameworks, ORM, Encapsulation.

Programming languages/environments aside, are there many developers who are using a framework in PHP, ORM and still abide by encapsulation for the DAL/BLL? I'm managing a team of a few developers and am finding that most of the frameworks require me to do daily code inspection because my developers are using the built in ORM. Right now...

Issue with a JPA query

I am trying to execute the following JPA query: public static final String UPDATE_INVENTORY_CUSTOMER_FOR_AMS_MAPPING = "UPDATE Inventory inventory SET" + " inventory.customer.id = :" + DataAccessConstants.PARAM_CUSTOMER_ID + " ,inventory.lastUpdateUserId = :" + DataAccessConstants.PARAM_USER_ID + " where inventory.amsCo...

Fluent NHibernate SqlDateTime overflow exception

Hey, I'm mapping a very simple Users table, and i have a column named 'LastLoginDate' which is defined as nullable in sql server. My mapping looks like this : public Users { Id(x => x.UserId); Map(x => x.UserName); ... ... Map(x => x.LastLoginDate).Nullable(); } But everytime I try to save this entity programatic...

How to specify the cardinality of a @OneToMany in EclipseLink/JPA

I'm trying to impose a @Oneto7 association. I'd have imagined an attribute that specifies the target many value, but have found none. If there is no such attribute, how else, in JPA/EclipseLink would one achieve it? ...

Django ORM dealing with MySQL BIT(1) field

In a Django application, I'm trying to access an existing MySQL database created with Hibernate (a Java ORM). I reverse engineered the model using: $ manage.py inspectdb > models.py This created a nice models file from the Database and many things were quite fine. But I can't find how to properly access boolean fields, which were mapp...

SQL, MVC, Entity Framework

Hi Im using the above technologies and have ran into what I presume is a design issue I have made. I have an Artwork table in my DB and have been able to add art (I now think of these as Digital Products) to a shopping cart + CartLine table fine. The system I have that adds art to galleries and user accounts etc works fine. Now the cl...

Oracle Hibernate with in Netbean RCP

All, i have a problem with hibernate using netbean platform 6.8, i have been search around internet, but cannot found the suitable answer This is my story. i am using oracle database as data source of my hibernate entity with ojdbc14.jar driver. First i create hibernate entity tobe wrapped latter in a netbeans module, i tested the h...

Which ORM to use?

I'm developing an application which will have these classes: class Shortcut { public string Name { get; } public IList<Trigger> Triggers { get; } public IList<Action> Actions { get; } } class Trigger { public string Name { get; } } class Action { public string Name { get; } } And I will have 20+ more classes, whi...

POJO from HBM file

HI All, I am new to hibernate and I would to create POJO from xxx.hbm.xml file. Is it possible? Please respond Regards, Vikram A. Deshpande ...

How to fine tune FluentNHibernate's auto mapper?

Okay, so yesterday I managed to get the latest trunk builds of NHibernate and FluentNHibernate to work with my latest little project. (I'm working on a bug tracking application.) I created a nice data access layer using the Repository pattern. I decided that my entities are nothing special, and also that with the current maturity of ORM...