Building Enterprise HTML5 Application

brite.dao

brite.dao(entityType)

Return the dao object for a specific entityType. Dao object are following the singleton pattern, meaning it for any given entityType it will always return the same Dao object.

  • entityType {string} : The unique name of the view (i.e. "ProjectView")

returns {Dao} Returns the Dao object for this entityType.

Examples

// get the userDao   
var userDao = brite.dao("User");

userDao.get(userid).done(function(user){
  console.log("we got user: " + user.name);
});

// Note: that brite.dao(entityType) returns always the same dao object
// for the same entityType. So, here we would have:
var userDao2 = brite.dao("user");
// userDao2 === userDao

Ask, learn, share about brite.js

Go to brite.js G+ community