April 12, 2013 Re: HibernateD and DDBC - ORM and DB abstraction layer for D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Vadim Lopatin | Am 12.04.2013 15:17, schrieb Vadim Lopatin:
> Still cannot build library using DUB.
>
> Tried different changes in package.json
>
> dub -v
> ...
> [7F6FC283306F:00000000 INF] Running dmd (compile)...
> [7F6FC283306F:00000000 dbg] dmd -w -g -debug -c -oftemp.o
> -version=USE_MYSQL -I/home/lve/src/ddbc/source source/drivers/sha1.d
> source/drivers/pgsqlddbc.d source/drivers/pgsql.d
> source/drivers/mysqlddbc.d source/drivers/mysql.d source/drivers/utils.d
> source/drivers/sqliteddbc.d source/common.d source/core.d
> [7F6FC283306F:00000000 INF] Linking...
> [7F6FC283306F:00000000 dbg] dmd -of/tmp/dub/2946988246/libddbc.a temp.o
> /usr/lib/x86_64-linux-gnu/libphobos2.a(dmain2_47f_1a5.o): In function
> `main':
>
>
> Why does it try to link app executable instead of just link library?
>
>
> package.json:
>
> {
> "name": "DDBC",
> "description": "DB Connector for D language, similar to JDBC",
> "authors": ["Vadim Lopatin"],
> "homepage": "http://sourceforge.net/projects/ddbc",
> "license": "Boost Software License (BSL 1.0)",
> "sourcePaths": ["source", "source/drivers"],
> "configurations": [
> {
> "name": "MySQL",
> "versions": ["USE_MYSQL"],
> "targetType": "staticLibrary",
> "targetPath": "bin",
> "targetName": "ddbc",
> }
> ]
> }
Try to move targetType one level higher?
|
April 12, 2013 Re: HibernateD and DDBC - ORM and DB abstraction layer for D | ||||
---|---|---|---|---|
| ||||
Posted in reply to David | On Friday, 12 April 2013 at 13:22:41 UTC, David wrote: >> [7F6FC283306F:00000000 INF] Linking... >> [7F6FC283306F:00000000 dbg] dmd -of/tmp/dub/2946988246/libddbc.a temp.o >> >> Why does it try to link app executable instead of just link library? > > Try to move targetType one level higher? Tried. Doesn't help. Changing of targetType to "library" instead of "staticLibrary" doesn't help, too. Link command is always the same: dmd -of/tmp/dub/2946988246/libddbc.a temp.o |
April 13, 2013 Re: HibernateD and DDBC - ORM and DB abstraction layer for D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Vadim Lopatin | First off; Awesome project (just discovered this). Is it possible set up the mapping externally in some sort of xml configuration file (without using attributes)right now? If not, is it planned for future? The reason i ask is because i started playing around with nhibernate recently, and really like the fact that i did not have to polute(for lack of a better term) the code file with attributes. e.g. <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="Something.Core" namespace="Something.Core.Data.Models"> <class name="User"> <id name="Id"> <generator class="native"></generator> </id> <property name="FirstName" /> <property name="LastName" /> </class> </hibernate-mapping> |
April 16, 2013 Re: HibernateD and DDBC - ORM and DB abstraction layer for D | ||||
---|---|---|---|---|
| ||||
Posted in reply to michaelc37 | On Saturday, 13 April 2013 at 16:23:04 UTC, michaelc37 wrote:
> First off; Awesome project (just discovered this).
>
> Is it possible set up the mapping externally in some sort of xml configuration file (without using attributes)right now?
> If not, is it planned for future?
>
> The reason i ask is because i started playing around with nhibernate recently, and really like the fact that i did not have to polute(for lack of a better term) the code file with attributes.
>
> e.g.
> <?xml version="1.0" encoding="utf-8" ?>
> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
> assembly="Something.Core"
> namespace="Something.Core.Data.Models">
>
> <class name="User">
> <id name="Id">
> <generator class="native"></generator>
> </id>
> <property name="FirstName" />
> <property name="LastName" />
> </class>
>
> </hibernate-mapping>
It's possible to implement this feature, although it would require compile-time XML parsing.
But I don't see big benefits from it. It's inconvenient and error prone. Properties of the same entity should be edited in two separate files, and kept in sync.
Historically, XML annotations were replaced with @ annotations in JPA/Hibernate once Java got support of @annotations.
Even XML files were usually generated automatically from JavaDoc annotations inside comments.
|
April 16, 2013 Re: HibernateD and DDBC - ORM and DB abstraction layer for D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Vadim Lopatin | Sorry, the library target types are still not fully implemented. But if the package is used as a dependency instead of being directly built, it will be properly used as a library instead of as an executable. I would go with the following minimal package description for now (the source folder and targetType="library" is inferred automatically): { "name": "DDBC", "description": "DB Connector for D language, similar to JDBC", "authors": ["Vadim Lopatin"], "homepage": "http://sourceforge.net/projects/ddbc", "license": "Boost Software License (BSL 1.0)", "configurations": [ { "name": "MySQL", "versions": ["USE_MYSQL"] } ] } However, there is one issue: The package registry needs to get either sourceforge.net support, or support to upload arbitrary files (which is difficult in the long term because of disk space usage). But even without that support, the package can be used for now using: $ svn co ... hibernated $ dub add-local hibernated ~master with other projects adding it to their package description with: { "dependencies": {"hibernated": "~master"} } I'll try to get the missing things sorted out shortly. Am 12.04.2013 15:17, schrieb Vadim Lopatin: > Still cannot build library using DUB. > > Tried different changes in package.json > > dub -v > ... > [7F6FC283306F:00000000 INF] Running dmd (compile)... > [7F6FC283306F:00000000 dbg] dmd -w -g -debug -c -oftemp.o > -version=USE_MYSQL -I/home/lve/src/ddbc/source source/drivers/sha1.d > source/drivers/pgsqlddbc.d source/drivers/pgsql.d > source/drivers/mysqlddbc.d source/drivers/mysql.d source/drivers/utils.d > source/drivers/sqliteddbc.d source/common.d source/core.d > [7F6FC283306F:00000000 INF] Linking... > [7F6FC283306F:00000000 dbg] dmd -of/tmp/dub/2946988246/libddbc.a temp.o > /usr/lib/x86_64-linux-gnu/libphobos2.a(dmain2_47f_1a5.o): In function > `main': > > > Why does it try to link app executable instead of just link library? > > > package.json: > > { > "name": "DDBC", > "description": "DB Connector for D language, similar to JDBC", > "authors": ["Vadim Lopatin"], > "homepage": "http://sourceforge.net/projects/ddbc", > "license": "Boost Software License (BSL 1.0)", > "sourcePaths": ["source", "source/drivers"], > "configurations": [ > { > "name": "MySQL", > "versions": ["USE_MYSQL"], > "targetType": "staticLibrary", > "targetPath": "bin", > "targetName": "ddbc", > } > ] > } |
April 17, 2013 Re: HibernateD and DDBC - ORM and DB abstraction layer for D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sönke Ludwig | On Tuesday, 16 April 2013 at 07:41:04 UTC, Sönke Ludwig wrote:
> Sorry, the library target types are still not fully implemented. But if
> the package is used as a dependency instead of being directly built, it
> will be properly used as a library instead of as an executable.
>
Hello,
I've sent pull request with fix.
At least this fix resolves ddbc build issue.
P.S: I've registered ddbc and hibernated in DUB repository.
|
April 17, 2013 Re: HibernateD and DDBC - ORM and DB abstraction layer for D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Vadim Lopatin | > P.S: I've registered ddbc and hibernated in DUB repository.
I have tried to generate a visuald project which depends on both.
There is a couple of issues.
1. Since you use prefix hibernated (for example, hibernated.core) there should be subfolder hibernated under source. And the source code should go there.
2. In dependencies I was forced to use version "~master" instead of a certain version.
Is there a simple example of using hibernated with sqlite driver?
|
April 18, 2013 Re: HibernateD and DDBC - ORM and DB abstraction layer for D | ||||
---|---|---|---|---|
| ||||
Posted in reply to kdmult | On Wednesday, 17 April 2013 at 13:46:30 UTC, kdmult wrote:
>> P.S: I've registered ddbc and hibernated in DUB repository.
>
> I have tried to generate a visuald project which depends on both.
> There is a couple of issues.
> 1. Since you use prefix hibernated (for example, hibernated.core) there should be subfolder hibernated under source. And the source code should go there.
> 2. In dependencies I was forced to use version "~master" instead of a certain version.
>
> Is there a simple example of using hibernated with sqlite driver?
I've fixed directory structure.
You need to use SQLite config for both DDBC and HibernateD (USE_SQLITE version code defined).
Look at unittests for sample usage (hibernated.tests module).
You need sqlite .lib and .dll to build under windows.
|
April 29, 2013 Re: HibernateD and DDBC - ORM and DB abstraction layer for D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Vadim Lopatin | On Friday, 5 April 2013 at 07:32:55 UTC, Vadim Lopatin wrote:
> @Embeddable // required for Embeddable
> class Address {
> String zip; // @Null
> String state; // @Null
> string streetAddress; // @NotNull
> }
Is it good to assume string is not null? For most scenarios there's little difference between null and empty string.
|
April 29, 2013 Re: HibernateD and DDBC - ORM and DB abstraction layer for D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kagamin | Am 29.04.2013 11:25, schrieb Kagamin:
> On Friday, 5 April 2013 at 07:32:55 UTC, Vadim Lopatin wrote:
>> @Embeddable // required for Embeddable
>> class Address {
>> String zip; // @Null
>> String state; // @Null
>> string streetAddress; // @NotNull
>> }
>
> Is it good to assume string is not null? For most scenarios there's little difference between null and empty string.
Null blows up your code, "" doesn't. Also it's a SQL thing, "NotNull" must be initialized, when the row is filled.
|
Copyright © 1999-2021 by the D Language Foundation