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
1 answer

Doctrine ORM level difference between @UniqueConstraint and @Column(unique=true) options

In database level, there is no difference when using one over another option for defining UNIQUENESS as shown below. Although @UniqueConstraint reads in its documentation "It only has meaning in the SchemaTool schema generation context", is there a…
BentCoder
  • 10,692
  • 17
  • 82
  • 143
7
votes
3 answers

What have your experiences been with Entity Framework?

EF has been out for awhile now and I'm considering evaluating it - what have your experiences been? I am interested in both web and desktop applications, and maybe some comparisons between EF and other ORM tools that you've used. Learning curve is…
Brian MacKay
  • 28,374
  • 14
  • 82
  • 116
7
votes
1 answer

Beego: Creating a new orm before every request?

Currently I'm using following commands at the beginning of each function that accesses the database. o := orm.NewOrm() o.Using("default") // Using default, you can use other database It feels like I should do that only once at router…
Michael
  • 5,193
  • 8
  • 40
  • 71
7
votes
2 answers

Map subclass as its extended parent

I have created the following abstract class, which use single table inheritance and maps subclasses on the DiscriminatorColumn model. /** * @Entity * @Table(name="entity") * @InheritanceType("SINGLE_TABLE") * @DiscriminatorColumn(name="model",…
Bas Peeters
  • 3,085
  • 4
  • 30
  • 47
7
votes
1 answer

Can you use Dapper to refresh existing object references rather than always returning new ones?

TLDR version: Is it possible to use the Dapper ORM to manually update already-existing in-memory object instances to the latest values in the DB rather than always returning new instances? Longer version: We have built our own caching mechanism to…
Mark A. Donohoe
  • 23,825
  • 17
  • 116
  • 235
7
votes
4 answers

Redbean O/RM store "date" as varchar(255)?

From this code: $toolbox = RedBean_Setup::kickstartDev("mysql:*****************"); $r = $toolbox->getRedBean(); $test = $r->dispense("test"); $test->nom = 'Test #1'; $test->date = '2010-07-08'; $test->date_deux = '08/07/2010'; $test->num = 5; $id…
Sirber
  • 3,130
  • 5
  • 23
  • 32
7
votes
2 answers

JPA mapping for a List or Set

Being new to ORM, I'd like to find a way to define a simple (meaning without an additional entity) mapping for a list (or a set) of strings within an entity. I found this sample: import java.util.Set; import…
Blablalux
  • 465
  • 1
  • 5
  • 9
7
votes
1 answer

Python getter and setter via @property within SqlAlchemy model class definition: HOWTO

So I am very new to sqlalchemy and ORM. I have an existing database, postgresql, and I have created a model to communicate to the database. Below is the class for my Transcribers table. All of whcih works when querying via it. I am just having…
thomascrha
  • 143
  • 1
  • 11
7
votes
4 answers

Is it illegitimate to name an JPA entity "Group"?

I'm developing a JEE6-application, using JPA 2.0 and Hibernate 3.5.2-Final as the Provider (and MySQL 5.1.41). My Application Server is Glassfish V3.0.1. I already have a working CRUD-app with some entities and relationships. Now i added an (really…
Wolkenarchitekt
  • 17,351
  • 28
  • 102
  • 166
7
votes
7 answers

How to fetch associated entities with Hibernate

I am developing an application using Spring rest and Hibernate and I want to get nested records from database like I'm getting Profession for a User, now I want to fetch Users associated to the Profession I fetched previously. Here is my Dao…
java developer
  • 117
  • 2
  • 6
7
votes
6 answers

Hibernate and JPA, what to use, where?

Could someone please explain to me what the main differences are between JPA and Hibernate? Where to use Hibernate ? Where to use JPA? Why not entity bean?
Tony
  • 8,173
  • 15
  • 54
  • 73
7
votes
2 answers

Update OneToMany list after entity save in Hibernate

i have relationship: // In A.java class @OneToMany(mappedBy="a", fetch=FetchType.LAZY) @Cascade(CascadeType.SAVE_UPDATE) private List bList; // In B.java…
blow
  • 11,391
  • 23
  • 66
  • 104
7
votes
1 answer

too many connections using eloquent orm and mysql

I'm using SLIM Framework with Laravel's Eloquent ORM for REST APIs. Recently I faced a problem of too many connections. During one request URI, I need to make several Get and Set calls to mySql DB. This opens connections on every DB transaction I…
7
votes
3 answers

Starting with existing database on Laravel 5

I have been enjoying working on Laravel for a while now, and am planning to move a fairly large project to Laravel 5. The new project has fairly large database with numerous tables, and it would take considerable amount of time build migrations,…
Santosh Achari
  • 2,684
  • 6
  • 24
  • 47
7
votes
5 answers

Persist 1-m entities with composite primary key in hibernate

I have below 1-m relationship on entities which Mentor to Students. The mentor has composite primary key which i use as foreign key in student @Entity public class Mentor implements Serializable { private static final long serialVersionUID =…
Harshana
  • 6,169
  • 17
  • 83
  • 152
1 2 3
99
100