orm

Best practice: Creating ORM objects at runtime by scheme stored in DB

Hi! At my current project(huge enterprise system) I'm faced to scenario when "simple" objects like table, reference list are created at runtime via system info stored in the same DB(special sys tables). Users can create those simple objects and relations between them. The complicated objects are created by developers. For the first case ...

JPA vs. JDBC, stored procedures and Co. or How to convince old school programmer to try ORM?

This is something I deal periodically with, and first time it was me who needed conviction. Luckily, I just tried, made extra effort to learn and thanks to this book, Spring support, and Hibernate I won't start a project without considering JPA. But not everyone is willing to go extra mile that often (just in anything we deal with I gues...

Is there a Ruby on Rails framework like equivalent for .NET development?

Answers like ASP.NET MVC or Entity Framework really aren't acceptable as they address just one aspect of the problem domain. I'm looking for a framework ... a REAL framework that gives me the same features out of the box that Rails does. As such it should include at minimum: MVC for presentation ORM Ability to provide simple configur...

ORM and performance issues

Hello, i'm thinking about learning ORM stuff but i think one thing: if i have a table (or some joined tables) with millions of records .... is it good to have mapped objects with millions of items ??? Is it sane to handle so big objects?? Thanks ! c. ...

how to implement inheritance in hibernate ??

I have a entities as: BaseEntity --> Which contains user login info like createdBy, createdTime, EditedBy, editedTime Employee --> which contains employee information like name, address, etc... RegularEmployee --> which contains salary, bonus tht kind of fields and ContactEmployee --> which contains HourlyRate, contactPeriod etc.... ...

Handling user security scope with nHibernate or other ORM

How should one handle the situation where you may need to filter by a group of users. Here is the scenario. I have an administrator role in my company. I should be able to see all the data belonging to me plus all the other users who I have control over. A plain old user however should only be able to access their own data. If you a...

Where to start .NET Entity Framework and ORM?

Hello I haven't used any database system enough but i believe i know logic of databases and i have learnt little sql so i shouldn't start to learn ORM before learn them well? Where can i start to learn .NET Entity Framework and which version of framework i have to start 3.5 or 4.0 because i heard that 4.0 has strong support for Enti...

How to order by list Index in HQL query?

This is situation I have: I have two entities with one-to-many relationship mapped like that (only relevant parts are given): <class name="xyz.Survey"> <list name="answers" inverse="true" lazy="true" fetch="select" cascade="all-delete-orphan"> <key column="OPA_OP_ID" not-null="true" /> <list-index c...

assembling an object graph without an ORM -- in the service layer or data layer?

At my current gig, our persistence layer uses IBatis going against SQL Server stored procedures (puke). IMHO, this approach has many disadvantages over the use of a "true" ORM such NHibernate or EF, but the one I'm trying to address here revolves around all the boilerplate code needed to map data from a result set into an object graph. ...

When to use Hibernate?

Hi All, I was asked in an interview this question so I answered with the following: -Better Performance: - Efficient queries. - 1st and 2nd level caching. - Good caching gives better scalability. - Good Database Portability: - Changing the DB is as easy as changing the dialect configuration. - Increased Developer Productivity: ...

SOA design principles with regards to database relationships

If I were to extricate my current membership provider from my solution, i.e. as a dll and expose it as a web service with it's own db, how would I model the relationships with regards to SOA design. For example I have a table: USER id, name, lastname, username, password, role. and table PRODUCT id, name, price, createdate, userid t...

Hibernate without primary keys generated by db?

I'm building a data warehouse and want to use InfiniDB as the storage engine. However, it doesn't allow primary keys or foreign key constraints (or any constraints for that matter). Hibernate complains "The database returned no natively generated identity value" when I perform an insert. Each table is relational, and contains a unique ...

NHibernate mapping with no empty constructor and no setters

I'm testing how difficult it is to use NHibernate with a domain that is completely unaware of it and isn't bent to accodomate any limitations. On many examples I found on the web the domain being mapped is yet another example of an anemic domain, where objects don't go far from being simple data holders. Sure, this makes the mapping sim...

Fluent nHibernate - How to map a non-key column on a junction table?

Taking an example that is provided on the Fluent nHibernate website, I need to extend it slightly: I need to add a 'Quantity' column to the StoreProduct table. How would I map this using nHibernate? An example mapping is provided for the given scenario above, but I'm not sure how I would get the Quantity column to map to a property o...

Hibernate EntityManagerFactory EntityManager

Can I create an EntityManager from EntityManagerFactory outside a bean. If so, how would I do it? ...

How to remove specific dql part in a doctrine Doctrine_RawSql query ?

i have read this http://stackoverflow.com/questions/1567652/doctrine-how-to-remove-part-of-a-where-clause-from-select-query-inside-listener but, i still cant see how to remove specific part, this is not explicitly written, can some one explain me how ? a sample of my Doctrine_RawSql $a = new Doctrine_RawSql(); $a->select...

how openjpa2.0 enhances entities at runtime?

Below is my test code: package jee.jpa2; import java.util.List; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.EntityTransaction; import javax.persistence.Persistence; import javax.persistence.Query; import org.testng.annotations.BeforeClass; import org.testng.annotatio...

Generate A Simple Read-Only DAL?

I've been looking around for a simple solution to this, trying my best to lean towards something like NHibernate, but so far everything I've found seems to be trying to solve a slightly different problem. Here's what I'm looking at in my current project: We have an IBM iSeries database as a primary repository for a third party software...

LINQ Foreign Key Relationship Naming (Address, Address1, Address2)

Hello, is it possible to change the foreign key relationship object naming of LINQ to SQL generated objects? For example, I have a Demo table which has the fields ItemMinId, ItemMaxId, ItemExlId which are all foreign key references to my Item table. LINQ generates now Demo.Item, Demo.Item2, Demo.Item3 fields which makes it difficult in...

Nhibernate not tracking changes

I'm using nhibernate and it appears that changes to my new object are not persisted. After creating and saving an object I then modify it and commit the transaction. However none of the modifications are saved. The strange thing is this code was working previously and I have no idea what could cause this. Nothing was changed that's obvio...