orm

No improvement in speed when using Ehcache with Hibernate

I'm getting no improvement in speed when using Ehcache with Hibernate Here are the results I get when i run the test below. The test is reading 80 Stop objects and then the same 80 Stop objects again using the cache. On the second read it is hitting the cache, but there is no improvement in speed. Any idea's on what I'm doing wrong? ...

hibernate Query by primary key

Hi ... I wanna create query by primary key. Supposed I have class primary key, PersonKey, the properties is name and id. I have Person class, the property is PersonKey, address, DOB. Now, I wanna search person by primary key. First, I create instance of PersonKey, and set the name become: joe, and id become:007 can I get the person ...

PHP: ORM framework or library that I can use with my database table structure

Hi, I was using KohanaPHP ORM but I can't use it with my database table structure. So, I need a framework or library ORM to use with it. With Kohana I need to follow a naming convention. I can't use a field name (foreign key) like 'idUnidadeMedida'. Are there any suggestions? Thank you. ...

When to use Stored Procedures instead of using any ORM with programming logic?

Hi all I wanted to know when I should prefer writing stored procedures over writing programming logic and pulling data using a ORM or something else. ...

Conditional relation

I've got a model like this: Stem -id -etc And then I have Stemrelation -stem_id -related_stem_id -active I can get the related stems with the following relations class Stem < ActiveRecord::Base has_many :stemrelations has_many :related_stems, :through => :stemrelations end class Stemrelation < ActiveRecord::Base b...

Easy way to convert a Doctrine_Collection of Model classes to an array of simple objects?

To clearly separate the Controller and View layers, I do not longer want to pass full objects to my views. Instead I want to pass only arrays and objects that contain the data but do not have any methods. Otherwise a view script would be able to delete Doctrine records or traverse in the object tree to data that was not intended for the ...

Hibernate doesn't generate cascade

Hi. I have a set hibernate.hbm2ddl.auto to create so that Hibernate creates the tables in mysql for me. However, it doesn't seem that hibernate correctly adds Cascade on the references in the table. It does however work when I for instance delete a row, and I have a delete cascade as hibernate annotation. So I guess that means that Hib...

[Hibernate] Problem with saveOrUpdate()

Hi, I've problem with Hibernate. I have a class User class User { int id; String name; } where id is native generator in User.hbm.xml , and name is primary-key in DB. In my database , I saved some information about Users. Than, I want to connect with this information about User. For example in my DB i have row INSERT INTO U...

Hierarchical Hibernate, how many queries are executed?

So I've been dealing with a home brew DB framework that has some seriously flaws, the justification for use being that not using an ORM will save on the number of queries executed. If I'm selecting all possibile records from the top level of a joinable object hierarchy, how many separate calls to the DB will be made when using an ORM (...

Is there an ORM that allows a "plugin" to extend the database?

So, I've been searching for the answer to this, but I can't find anything I have an Entity Framework Model (MyModel1) - for now, we'll say this contains a "Users" table It's part of a big app, that has a references to an "Addresses" project The addresses project contains an Entity Framework Model (MyModel2), this contains a Users tabl...

API To Object Mapping in PHP

We have so many ORM (Object Relational Mapping) software: http://en.wikipedia.org/wiki/List_of_object-relational_mapping_software#PHP How about API to Object mapping? Edit We don't use database, but API. So all data come from REST APIs. Classic ORMs do not seem to handle that. Looks like I should do my own using Zend's code generator...

How to map combinations of things to a relational database?

I have a table whose records represent certain objects. For the sake of simplicity I am going to assume that the table only has one column, and that is the unique ObjectId. Now I need a way to store combinations of objects from that table. The combinations have to be unique, but can be of arbitrary length. For example, if I have the Obje...

Migrating from hand-written persistence layer to ORM

Hi community, We are currently evaluating options for migrating from hand-written persistence layer to ORM. We have a bunch of legacy persistent objects (~200), that implement simple interface like this: interface JDBC { public long getId(); public void setId(long id); public void retrieve(); public void setDataSource(...

Memory leak in Websphere 7 + EJB3, a lot of instances of ClassMapping

Hi, sorry for my english, I speak spanish. I recently migrate an application from ejb 2.x to ejb3 (approx. 300 entities), Im using WebSphere 7.0.0.9. After 10 hours of work, the system crash with an OutOfMemoryError. Analyzing the coredump, I see a lot of instance of the org.apache.openjpa.jdbc.meta.ClassMapping class (please see the a...

Help choose a code generation tools for ASP.NET

Hello, I am new to the code generation tools and I would like to know how does a tool like LLBGen Pro compares with the Entity Framework? On top of that my boos is really looking into a tool called CodeOnTime http://codeontime.com/default.aspx because he likes their good UI support. I am asking here because I really want an unbiased o...

Implementing tagging in JDO

I am implementing a tagging system for a website that uses JDO . I would like to use this method. However I am new to relationships in JDO. To keep it simple, what I have looks like this: @PersistentCapable class Post { @Persistent String title; @Persistent String body; } @PersistentCapable class Tag { @Persistent String name; } Wha...

Good design of mapping Java Domain objects to Tables (using Hibernate)

Hey guys, I have a question that is more in the realm of design, than implementation. I'm also happy for anyone to point out resources for the answer and I'll gladly, research for myself. Highly simplified Java and SQL: Say I have a business domain POJO called 'Picture' with three attributes. class Picture int idPicture Str...

Nhibernate id’s with sequential one step incremented id’s (alternatives to HiLo)

How do I instruct Nhibernate to generate sequential one step primary keys, like the sql generated ones? The current HiLo algorithm generates keys like 4001 then 5010, 6089 etc. I understand that this is to manage multiple app servers etc. But I don’t have that problem. I need nhibernate to pick up the highest record set value during...

Entity Framework vs. nHibernate for Performance, Learning Curve overall features

I know this has been asked several times and I have read all the posts as well but they all are very old. And considering there have been advancements in versions and releases, I am hoping there might be fresh views. We are building a new application on ASP.NET MVC and need to finalize on an ORM tool. We have never used ORM before and h...

Can object oriented databases be a better option than a relational database with an ORM?

Just thinking that a relational db with an ORM is in many ways very similar to an object oriented database. My experience lies solely with RDMS with a hint of ORM, so it seems to me that object oriented databases are very similar but without the experience I can't say for sure. If you have used object oriented databases and ORMs can yo...