Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

 

Description

Variables and attributes of type blob representing valid CSV files can be parsed to collections of object instances. Please see the overview section of this page for clarity on what defines a "valid" CSV file.

 

 

Example

The code snippets below demonstrates how the fromCsv built-in function can be used populate a collection of Nurse object instances:

 

Code Block
languagejava
titleRelated model objects
persistent object Clinic {
    string name;
}
 
persistent object Nurse {
	string first_name;
	datestring birthlast_datename;
 
	@ManyToOne
	Clinic clinic;
}
 
object UploadedFile {
    blob data;
}
Code Block
languagejava
titleUnit function using fromCsv
linenumberstrue
 
 Nurse[] extractNurses(UploadedFile f) {
    return Nurse:fromCsv(f.data);
}
Code Block
titleExample CSV file
 

 

 

 

Additional Mentions and References