Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
January 09, 2019 hunt entity v2.1.0 released! | ||||
---|---|---|---|---|
| ||||
Hunt Entity is an object-relational mapping (ORM) framework for dlang's database, support PostgreSQL / MySQL / SQLite. This version added pagination for EQL's createQuery(); Example 1 for pagination: ```D class User { mixin MakeModel; @AutoIncrement @PrimaryKey int id; string name; } auto query = em.createQuery!User("SELECT * FROM User", new Pageable(0, 10)); auto page = query.getPageResult(); logDebug("Page NO: %s, size of Page: %s, Total Pages: %s, Total: %s".format(page.getNumber(), page.getSize(), page.getTotalPages(), page.getTotalElements())); foreach (user; page.getContent()) { logDebug("User[%s] is: %s".format(user.id, user.name)); } ``` Example 2 for limit && offset : ```D class User { mixin MakeModel; @AutoIncrement @PrimaryKey int id; string name; } auto query = em.createQuery!User("SELECT * FROM User").setFirstResult(10).setMaxResults(20); foreach (user; query.getResultList()) { logDebug("User[%s] is: %s".format(user.id, user.name)); } ``` |
January 09, 2019 Re: hunt entity v2.1.0 released! | ||||
---|---|---|---|---|
| ||||
Posted in reply to Brian | Fix example code: https://github.com/huntlabs/hunt-entity/wiki/Pagination Github repo: https://github.com/huntlabs/hunt-entity |
January 09, 2019 Re: hunt entity v2.1.0 released! | ||||
---|---|---|---|---|
| ||||
Posted in reply to Brian | On Wednesday, 9 January 2019 at 11:34:07 UTC, Brian wrote: > Fix example code: > https://github.com/huntlabs/hunt-entity/wiki/Pagination > > Github repo: > https://github.com/huntlabs/hunt-entity Is your work related to shark? https://code.dlang.org/packages/shark Regards mt. |
January 09, 2019 Re: hunt entity v2.1.0 released! | ||||
---|---|---|---|---|
| ||||
Posted in reply to Martin Tschierschke | On Wednesday, 9 January 2019 at 14:12:06 UTC, Martin Tschierschke wrote:
> On Wednesday, 9 January 2019 at 11:34:07 UTC, Brian wrote:
>> Fix example code:
>> https://github.com/huntlabs/hunt-entity/wiki/Pagination
>>
>> Github repo:
>> https://github.com/huntlabs/hunt-entity
>
> Is your work related to shark?
> https://code.dlang.org/packages/shark
>
> Regards mt.
No, shark library "Entity" define looks like hunt-entity history version.
We team has hunt-database and hunt-sql support hunt-entity to work.
hunt-entity is so powerfull ORM.
shark is very simple, now.
|
January 09, 2019 Re: hunt entity v2.1.0 released! | ||||
---|---|---|---|---|
| ||||
Posted in reply to Brian | On Wednesday, 9 January 2019 at 11:28:58 UTC, Brian wrote:
> Hunt Entity is an object-relational mapping (ORM) framework for dlang's database, support PostgreSQL / MySQL / SQLite.
>
> [...]
Really cool! Thanks.
|
Copyright © 1999-2021 by the D Language Foundation