orm

ORM/Persistence layer Advice

Hi all I'm starting a new project and I'm looking around for either a very good ORM or for a non-SQL-based persistence layer. For this project, I really don't care on how the data is persisted, as long as it can be queried and stored with a reasonable speed and most importantly with simple queries. Concurrency should be handled seamlessl...

spring+hibernate mapping class without xml

in my applicationContext.xml, this is how I map xml to POJO. how to map directory to class file without required to create xml? <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="mappingResources"> <list> <value>com/custompackage/custom/spi/hibernate...

hibernate: create table with names in lowercase

Hibernate: I want to have hibernate automatically generate my tables with names in lowercase. For example, if my class is called com.myapp.domain.Customer, hibernate will generate a table named Customer. I want it to be called customer. I know I can use the @Table annotation to specify the table name per class. But I want it to happen "...

How to get the database time with JPQL?

Hi, with native SQL I get the database time with a statement like: SELECT CURRENT_TIMESTAMP with JPQL I get the same result with: SELECT CURRENT_TIMESTAMP FROM Customer c WHERE c.id=1 Is there a way to get rid of the last two lines? thanks, ...

Features needed when building a ORM with PHP?

I have never really appreciated ORM's so I think that the only way to remedy this is to build a basic one myself so I can see what all the hubbub is. So with that in mind, what are the basic features I would need to include to make a semi-usable ORM? As far as I can tell, it would basically need to work like this for the end programmer:...

Entity Framework POCO Does Not Fit Nicely with Domain Objects

I have taken a model first approach for a project i'm working on. An example of a class relationship is shown as follows, pretty strightforward: public class Product { public int Id { get; set; } public string Name { get; set; } List<Photo> Photos { get; set; } } public class Photo { public int Id { get; set; } public string...

How to access SessionFactory of Hibernate using JNDI in WEBLOGIC 9.2 server?

We are using Weblogoic9.2.3 & DB is Oracle10.2.0.3. How can we access Hibernate SessionFactory using JNDI? ...

JPA join column with null values

I have a query that works in plain SQL but is not working on JPA and can't figure out why. As you can guess from the title I have a clue but I don't know how to "fix" it. Here's the actual important code: @Id @Basic(optional = false) @Column(name = "id", nullable = false) private Integer id; @Basic(optional = false) @Column(name ...

2 JPA entities on the same table.

Let's say I've a table with 200 columns and most of them are never used. I map SmallEntity to the 10 columns that are used often. I use it in the associations with other entities. It loads fast, consume few memory and makes me happy. But sometimes I need to display the 200 columns. I'd like to map the BigEntity class on the 200 columns...

Basic clarifications about NHibernate

Given that I'm very good with SQL and c#, Should I learn another layer on top like NHibernate ? Is NHibernate just a library (that stores in a Database)? Or it's a service? Should I use NHibernate or ADO.NET Entity Framework? If you think I should learn/use an ORM, give me your top reason. ...

Problem with mapping tag in hibernate configuration file

I am using hibernate annotations and when I do following everything works fine sessionFactory = new AnnotationConfiguration() .addPackage("istreamcloudframework.objectmodel.member") .addAnnotatedClass(User.class) .buildSessionFactory(); but I wanted to avoid specifyin...

Is there a way to define reusable properties to n-hibernate mappings?

I have a scenario that i want to add some standard properties to my entities. Meaning that i will have e.g. 1 int and 2 string properties applied to all relevant entities. I have over 100 mapping files and most but not all will be hosts to these new properties. In the classes its easy to define this; in the mappings however i've found no...

Doctrine ORM: Create Table Like Another

Hello, Is there any way, when using Doctrine, to create a table like another? I know in MySQL there is a function to do so: CREATE TABLE user2 LIKE user; and tables user and user2 will be identical. Can this be done in Doctrine? ...

Intercepting property setting in Fluent NHibernate

I'm new to Fluent NHibernate, and have what I think should be a simple question. The problem is that I can't seem to find a simple answer anywhere. I have a database column that is an nvarchar (SQL Server). It should map to a model property that is a System.Uri. The problem is that string doesn't implicitly convert to Uri. Is there ...

Where do you "Load Balance" an ORM in a PHP MVC Application

The Problem: Object models built using an ORM often need to perform multiple queries to perform a single action. For example a "get" action may pull information from multiple tables, particularly when you have a nested object structure. On complicated requests these queries can add up and your database will start blocking long before it...

Which ORM should I use instead of Linq to Sql?

Hi Everyone, I'm working on a CMS as my hobby project. Because I'm not paid for it, time is not very essential and I aspire to make a well-architected system. I have a set of business classes which are responsible for the main logic, and they are getting data from a database through interfaces, and the data provider (which sould implem...

Are there any GOOD iPhone orms?

I'm traditionally a .NET developer and am spoiled for choice when it comes to ORMs. My flavor of choice is NHibernate but there are a bunch of choices out there. I was wondering if anyone here uses an ORM when developing for the iPhone and, if so, how do the featuresets compare with that of it's Java and .NET counterparts. I understand ...

How to model this situation in ORM (NHibernate)?

I've always taken a data centric approach to web apps, and so the paradigm change involved when taking a pure OO approach using ORMs is still not completely natural to me, and evey now and then something ostensibly simple is not obvious. Can someone please point me into the right direction of how to correctly model this situation in an ...

Problems Mapping Composition Relationships using Entity Framework

I'm trying to model my domain model using the entity framework. An example is Page class containing a Content class. public class Page { public virtual int Id { get; set; } public virtual string Name { get; set; } public virtual Content PageContent { get; set; } } public class Content { public IList<Version> Versions { ge...

Simple Data Access Layer

Can anyone suggest a simple Data Access Layer (C# .NET)? Not keen on using the Microsoft Application Data Access block, seems very bloated and overkill. Also don't want to use LINQ to SQL for various reasons. I want to build upon this and create our own in-house ORM, again for various reasons. In the past I've always had the Data Access ...