lundi 17 août 2015

Design a system in JAVA equivalent to relational database

I have a typical problem of designing a system in JAVA which works like a relational database.

To make it simple, lets say we have a table named Employee as bellow:

Employee:
 ID | Name | Manager | Salary

Now on this table i can write a query like

select * from Employee where ID= ' something'
select * from Employee where Name= ' something'
select * from Employee where salary = ' something' 

and so on.

Now I want the same implementation in java where I have one class as bellow:

class Employee
{

   String ID;
   Stirng Manager;
   String Name;
   Double salary;
}

How can i design a system which will return me same solution as we get when we execute the queries like above;

The solution should be with optimized complexity.

Aucun commentaire:

Enregistrer un commentaire