开发者

Views in GAE DataStore

开发者 https://www.devze.com 2023-04-08 08:57 出处:网络
The application is a simple task management system in which an employee can have multiple tasks and a task can be assigned to multiple employees. So the first Model is Employee, which has the followin

The application is a simple task management system in which an employee can have multiple tasks and a task can be assigned to multiple employees. So the first Model is Employee, which has the following attributes:

Class Employee {
 Long id; //primary key
 String name;
 String employeeCode;
 String position;
}

The task Model is as follows:

class Task {
 Long id //pri开发者_JAVA技巧mary key
 String name;
 String description
}

and an employee is assigned to tasks in the following relation:

Class EmployeeTasks {
 Long id // primary key
 Long employeeId;
 Long TaskId;
 Date assignedDate;
 Long assignedBy; //employee ID
}

I have two list views(through AJAX) for the employee module -

The first list has the following columns and it is intended for System Administrators:

Employee code | Name | Position | Date Created

The second list has the following columns and is for the Managers:

Employee Code| Name | Position| No of Tasks assigned | Date of last assignment

I know that in GAE we need to consider the queries(views) while designing the database model. So my question is whether the above model is ideal for my requirements?

The application is being developed in GAE+Spring+JDO+Jackson+YUI. Does it makes sense to stick on with this model and use Jackson ObjectMapper to change the views? Or is it a good practice to write non-persistent objects for the views?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号