Using Non primitive data types


#1

I am new to the framework and trying to implement Model like shown below. Instead of using primptive data types, I have custom types as a class. How do i build a model and view and also persist and retrieve from the data store?

Employee Class: department: string person: Person

Person Class: firstName: string, lastName: string, demographics: Demographics

Demographics Class: race: Race, ethnicity: Ethnicity language: Language

Race Class: name: string rubric: string default ISO 639-1

and so on…


#2

For relations between models you can define the relationships using DS.belongsTo() and DS.hasMany(). See http://emberjs.com/guides/models/defining-models/#toc_defining-relationships for more information.

If you need custom “data types” you can create your own transforms to handle serialization/deserialization of your properties: http://emberjs.com/api/data/classes/DS.Transform.html