Project

General

Profile

Bug #6076

[Wt::Dbo] How to work with entities without parameter-less constructors (classes that require an invariant)

Added by Oleg Artenii almost 5 years ago. Updated almost 5 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
10/30/2017
Due date:
% Done:

0%

Estimated time:

Description

I have a class with an explicit constructor that requires two parameters, without those parameters the instance is invalid. When I try to map it with Wt it requires a default parameter-less constructor (I think just to create an instance to be able to execute the persist() method).

Is there any way to make Wt to not construct an object but still be able to extract the mapping data for object?

As a quick fix I created a parameter-less constructor and initialize the required members with nullptr but this can cause troubles in future.

Also available in: Atom PDF