Questions tagged [orm]

Object-relational mapping (ORM) is a technique for mapping object-oriented systems to relational databases. Use other tags to indicate the programming language ([java], [sql], [python]), database system ([postgreSQL], content management system ([django]), framework ([flask], [spring], [laravel]), application environment ([android], [node.js]), and other tags that can be used for searches and have watchers.

Object-Relational Mapping

Object-Relational Mapping (ORM) is a technique for mapping object-oriented systems to relational databases. This creates, in effect, a "virtual object database" that can be used from within the programming language. There are both free and commercial packages available that perform object-relational mapping.

Resources

Related tags

17748 questions
7
votes
5 answers

Help needed for LINQ To SQL operations (insert/update) with nested POCO's

Ok well I've been trying to convert my model to use LINQ but didn't want to throw away my current DTO's and their interfaces which are scattered through the domain. I managed to find this blog post which has outlined the process quite…
mwjackson
  • 5,193
  • 8
  • 51
  • 55
7
votes
4 answers

Editing tables with ASP.Net - Quick 'n Dirty

I have need to provide a way for users to edit tables in ASP.Net. The tables are simple (no master/detail relationships), but there are likely to be a lot of them. What's the quickest/simplest way to provide a view/edit interface to a table, even…
Tim Coker
  • 6,126
  • 2
  • 29
  • 56
7
votes
2 answers

How to map the latest child of a collection with JPA and Hibernate

I have a Product entity class and I want it to join with the Price table. My goal is to persist the old prices for reporting and when I get the Product entity it should be mapped with latest price according to the latest date. Please explain me how…
Cool Java guy מוחמד
  • 1,637
  • 4
  • 22
  • 37
7
votes
6 answers

Automatically create C# wrapper classes around stored procedures

I've inherited a rather large application that really could use some cleanup. There is data access code littered throughout the application. In code behinds, some in business logic classes, some inline in in classic asp pages. What I'd like to do…
Aheho
  • 11,956
  • 13
  • 51
  • 76
7
votes
1 answer

FluentNHibernate Many-To-One References where Foreign Key is not to Primary Key and column names are different

I've been sitting here for an hour trying to figure this out... I've got 2 tables (abbreviated): CREATE TABLE TRUST ( TRUSTID NUMBER NOT NULL, ACCTNBR VARCHAR(25) NOT NULL ) CONSTRAINT TRUST_PK PRIMARY KEY (TRUSTID) CREATE TABLE…
Todd Langdon
  • 365
  • 6
  • 11
7
votes
2 answers

How do I write this JPQL query?

Say I have 5 tables, tblBlogs tblBlogPosts tblBlogPostComment tblUser tblBlogMember BlogId BlogPostsId BlogPostCommentId UserId BlogMemberId BlogTitle BlogId CommentText FirstName UserId …
TCM
  • 16,242
  • 43
  • 150
  • 245
7
votes
2 answers

How should I store an Java Enum in JavaDB?

How should I store an Java Enum in JavaDB? Should I try to map the enums to SMALLINT and keep the values in source code only? The embedded database is only used by a single application. Or should I just store the values as DECIMAL? None of these…
Jonas
  • 97,987
  • 90
  • 271
  • 355
7
votes
1 answer

Is this lambda? if not what is it?

a few days back i was trying the new ORM for delphi from Devart called EntityDAC, well i was reading the docs specific the LINQ part, when i saw something like: Linq.From(Emp).Where(Emp['Sal'] > 1000) got to say that wake me up the first moment i…
kabstergo
  • 741
  • 3
  • 15
7
votes
1 answer

JPA: Database Generated columns

I am facing an issue with Hibernate and JPA. My requirement is column CreatedDTTM and LastUPDATEDDTTM should be populated at the DB level. I have tried following but no use. My columns are set NOT NULL. I get a "cannot insert Null into…
jpanewbie
  • 91
  • 1
  • 4
7
votes
2 answers

Separating business logic from PHP Doctrine 2

I use symfony 2.3 and php doctrine 2. The program has the following models: entity Order - a typical customer order entity BadOrderEntry(fields: id, order - unidirectional one-to-one relationship with Order, createdAt) factory BadOrderEntryFactory…
stalxed
  • 1,023
  • 2
  • 9
  • 12
7
votes
1 answer

Converting SQL with subselect in select to HQL

I have the following SQL that I am having problems converting to HQL. A NPE is getting thrown -- which I think has something to do with the SUM function. Also, I'd like to sort on the subselect alias -- is this possible? SQL (subselect): SELECT…
RyanLynch
  • 2,839
  • 3
  • 32
  • 47
7
votes
1 answer

JPA @TableGenerator shared between multiple entities

I have a 'dog' Entitiy with an @Id and a @TableGenerator ... @TableGenerator(table = "seq", name = "dog_gen", pkColumnName = "seq_name", valueColumnName="seq_val") @Id @GeneratedValue(strategy = GenerationType.TABLE, generator = "dog_gen") private…
Mauricio
  • 5,739
  • 2
  • 26
  • 33
7
votes
1 answer

SQLAlchemy joins with composite foreign keys (with flask-sqlalchemy)

I'm trying to understand how to do joins with composite foreign keys on SQLAlchemy and my attempts to do this are failing. I have the following model classes on my toy model (I'm using Flask-SQLAlchemy, but I'm not sure this has anything to do with…
7
votes
8 answers

Home-grown ORM vs. DataTables?

This is a simplification of the issue (there are lots of ways of doing things), but among applications that need to talk to a database I have usually seen one of two patterns: Object-Relational Mapping (ORM), where (usually) each table in the…
MusiGenesis
  • 71,592
  • 38
  • 183
  • 324
7
votes
2 answers

Hibernate Relationship Mapping/Speed up batch inserts

I have 5 MySQL InnoDB tables: Test,InputInvoice,InputLine,OutputInvoice,OutputLine and each is mapped and functioning in Hibernate. I have played with using StatelessSession/Session, and JDBC batch size. I have removed any generator classes to let…
ashurexm
  • 5,921
  • 3
  • 42
  • 69
1 2 3
99
100