orm

Why JPA entity class and its methods must not be declared final ??

I think that it makes sense for the entity variables to not be final as they are synchronized with the DB, but why for class and methods ?? ...

Fetch multiple onetoMany relationships Hibernate JPA

I am using Hibernate JPA 1.0. I have the following type of model and I consider manyToOne and oneToOne relationships "eagerly" fetched and oneToMany "lazily" fetched. I want to fetch Entity A and all its associations where a.id=? A oneToMany B B oneToOne C C oneToMany D B oneToOne E E oneToMany D B oneToOne F F oneToMany D ...

Sharing nHibernate and hibernate 2nd level cache

Is it possible to share the 2nd level cache between a hibernate and nhibernate solution? I have an environment where there are servers running .net and servers running java who both access the same database. there is some overlap in the data they access, so sharing a 2nd level cache would be desirable. Is it possible? If this is not ...

Hibernate transform instance to subclass

Hi, I have mapped class in JPA. : @Entity @Inheritance(strategy = InheritanceType.JOINED) public class User { private Long id; private Long name; //getters and setters go here .... } I also have a subclass of this class, called Admin: @Entity public class Admin extends User { private String cridentials; //gett...

ORM in Django vs. PHP Doctrine

I am a PHP guy. In PHP I mainly use Doctrine ORM to deal with database issues. I am considering move to Python + Django recently. I know Python but don't have experience with Django. Can anyone who has good knowledge of both Doctrine and ORM in Django give me a comparison of features of these two ORM implementations? ...

Closing DataMapper DB connection

Hello, my rails application generates lots of small sqlite databases using DataMapper. After data saved, .sqlite-file must be uploaded on a remote server and destroyed locally. My question is how to make DataMapper close .sqlite db connection and free repo's memory? Application should generate many databases, so it's important to save ...

Please recommend .NET ORM for N-tier development

I need to choose carefully .NET ORM for N-tier application. That means, the I will have the server (WCF service), which exposes the data, and client, which displays it. The ORM should support all the related serialization issues smoothly - the objects or collections of objects, or whatever must travel across process boundaries. Ideally, ...

Questions about implementing Domain class relationships & constraints in Grails.

Using ArgoUML, I very quickly created this trivial representation of a few Domain classes (Person, Store, Product) and their relationships. I'm struggling with the implementation of the relationships. Below was my initial approach for the Person domain, but it seems that I am missing something important. class PersonToPerson { ...

how to make the criteria list returns 0 if nothing is added

How do you cause the criteria.list() to return 0 if nothing is "added" to the hibernate criteria? (The criteria returns all entries in the table.) ...

NHibernate many-to-many relationship question: can select, can't update

Each user has a list of roles: <class name="User" lazy="false" table="Users"> <id name="Id" type="int"> <generator class="native"/> </id> <property name="Name" /> <bag name="RoleList" table="User_Role" inverse="true" lazy="false" collection-type="Roles"> <key column="UserId" foreign-key="Id"/> <many...

Java ORM for Hbase.

Anyone knows a good Java ORM implementation for HBase. This one looks really nice for Ruby http://www.stanford.edu/~sqs/rhino/doc/ But could not find one for Java. Thanks. ...

Building an ObjectContext in EF Code First CTP4

I just upgraded to EF Code First CTP 4 and it looks like the ContextBuilder class was removed. I currently create my ObjectContext like so (in CTP 3): var contextBuilder = new ContextBuilder<ObjectContext>(); var connstr = ConfigurationManager.ConnectionStrings["MyConn"]; var connection = new SqlConnection(connstr.ConnectionString); var...

Hibernate - Saving Entities - Update Table - Not based on Primary Key

Pseudo code to get to the point: @Entity Person { @Id Integer id; String SSN; String name; } Use case for repository, or service: personRepository.save(new Person(ssn:"123456", name:"jeff")): id is unique and autoincremented primary key SSN is unique and is the identifier of a person name is just a string and could be ...

Databases and Deep Copy

If I find myself wanting to do a deep copy of an object stored in my relational database, have I necessarily done something fundamentally wrong architecturally? This is a different angle on another (much more detailed) question I asked, but haven't gotten much response to called Copying Relational Table Data. ...

Are there good third party EDMX generator/updater tools out there?

Are there good third party EDMX generator/updater tools out there? The visual studio EDMX is driving nuts. I constantly have to restart VS2008 in order to get the EDMX to properly update. Are there any tools out there people like? This is somewhat subjective but I figured it would be ok to ask nonetheless ...

Cascade in hibernate from the one to many side

Hi there, i know this question might be asked before, but i want to make it specific, am using hibernate without annotations, so my case is if I've the following relation: A has many of B and B has one of A, it's a one to many relation from A side, am dealing with A entity which contain set of B, then when Creating, Updating Bs in run...

Is there a REST based ORM?

I've been looking at JavaScriptMVC, and I'm pretty interested in the idea. I'm wondering, though, if there are any ORM solutions for such an architecture. It seems like you will end up having to write two data access layers, one server side to fetch items from the database and one on the client side to retrieve items via AJAX. My ques...

Hibernate Eclipse Plugin

Hi All, Can anyone suggest me a good eclipse plug-in for Hibernate. The plug in should take care of generation of POJO classes, hbm mapping files. Also provide a nice interface to execute HQL queries. Any help would be highly appreciated. Regards, Nitin Ware ...

Hibernate... how does one do database/SQL queries?

I (think I) understand that Hibernate offers me access to a relational database essentially as if I had a class(es) that matched whatever view(s) I define of some tables. How do I get the results of a specific query to be accessible via a class? In particular, can I issue a complex SQL query, and process multiple results? Do I lose an...

hibernate problem

I am new to hibernate , am getting the following error [INFO ][main][2010-07-16 17:36:13] HibernateUtil.java (l.66) : connection url = jdbc:derby:MATOSO_DB;create=true [ERROR][main][2010-07-16 17:36:14] SchemaExport.java (l.274) : schema export uns uccessful java.sql.SQLException: No suitable driver at java.sql.DriverManager.g...