Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hibernate like layer for C++

Using a DB with C++ is a real mess and it was refreshing when I moved to Java to be able to use a unified system to abstract the whole layer away (aka Hibernate).

There are a couple of C++ abstract layers for DB's out there but they are usually vendor specific and only a thin layer that wraps the real C API. Has anybody come across something more like hibernate for C++ or know of a group or open source project that is looking at this problem domain.

like image 796
Martin York Avatar asked Jan 17 '09 20:01

Martin York


4 Answers

There is now a completely in C++ written Hibernate layer. You can find it at github at edwig/CXHibernate. It comes with full written documentation.

like image 190
Edwig Huisman Avatar answered Nov 12 '22 09:11

Edwig Huisman


I feel your pain. You'll quickly be using separate libraries for database access, XML processing, threading, and everything else applications commonly need. For this reason I often use Qt, which provides most common functionality often need in programs (database access, XML processing, threading, GUI widgets, etc.). Their SQL classes are pretty decent and work with many databases. But it does not abstract SQL away like many object-relation mappers.

like image 41
danieldk Avatar answered Nov 12 '22 11:11

danieldk


We developed an open source library named QHibernate.

QHibernate is a Hibernate ORM(Object Relation Mapping) port for C++ and Qt Framework. Current version is a proof of concept work. It is used with PostgreSQL 9.4 and Qt 5.4.1.

Features

  • Qt5
  • PostgreSQL
  • Class mapping xml
  • Class mapping xml
  • Hibernate configuration xml
  • one-to-many, one-to-one, many-to-one mappings

You can find some details, source and download links here: QHibernate

like image 44
ufukgun Avatar answered Nov 12 '22 10:11

ufukgun


I don't know of any C++ library like Hibernate, but certainly there are non-vendor specific libs: SOCI and DTL

like image 7
Vadim Ferderer Avatar answered Nov 12 '22 09:11

Vadim Ferderer