I miss a feature for copying stored entity data to a new one without filling all manually in a Copy function like:

entity Address {
name : String
phone : String

function Copy() : Address {
return Address(name=this.name, phone=this.phone);
}
}

Submitted by Terje Pedersen on 2 May 2011 at 11:27

On 10 May 2011 at 10:03 Zef Hemel commented:

How deep should that copy be? What if Address has a collection of persons, or a ref to another entity object, should that collection be duplicated, should the items in the collection be duplicated?


On 10 May 2011 at 10:46 Terje Pedersen commented:

Good question, I think that would depend on the project. In my current project it seems like I need in one case copy all fields including references to other entities and duplicate all the collections. In another case I need copy of all fields, references and leave the collections empty like copying a blog entry without the comments attached to it.

Log in to post comments