Hibernate like layer for C++

前端 未结 6 1398
故里飘歌
故里飘歌 2021-02-05 22:11

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

相关标签:
6条回答
  • 2021-02-05 22:37

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

    0 讨论(0)
  • 2021-02-05 22:38

    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.

    0 讨论(0)
  • 2021-02-05 22:41

    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.

    0 讨论(0)
  • 2021-02-05 22:41

    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

    0 讨论(0)
  • 2021-02-05 22:43

    If you're using C++ with .Net, then use nhibernate. 2.0 is approximately the same as hibernate 3.0, and is extremely robust.

    0 讨论(0)
  • 2021-02-05 22:54

    Another approach is a C++ object <-> xml mapping like codesynthesis xsd
    I never liked the direct hibernate/serialisation approach it breaks too much if you ever need to change the class.

    0 讨论(0)
提交回复
热议问题