Multiple values in same entity attribute

Hi All

I have an employee table, that creates a list of all employees created in the application. I create a listing entity where all the employees assigned to some senior employee. To create database for the same, how should I design my db for Team listing. My entity attributes has one to many relation among them

Solution

Hi Kavya,

I think for this in employee entity you can take attribute like Manager Id (id of senior employee assigned to that employee). In this attribute you can save the employee Id of senior employee for each user. By this way in single entity you will be able to maintain the employee records and their managers (senior employee) id.

Thanks.

Solution

vikas sharma wrote:

Hi Kavya,

I think for this in employee entity you can take attribute like Manager Id (id of senior employee assigned to that employee). In this attribute you can save the employee Id of senior employee for each user. By this way in single entity you will be able to maintain the employee records and their managers (senior employee) id.

Thanks.

Thank you vikas . But I want to add multiple employees under a single manager in a separate entity. Is that possible in outsystems? 


Kavya Balaji wrote:

Hi All

I have an employee table, that creates a list of all employees created in the application. I create a listing entity where all the employees assigned to some senior employee. To create database for the same, how should I design my db for Team listing. My entity attributes has one to many relation among them


Hi Kavya,


You can create one entity "Managers" having attribute id, managerId (Employee identifier), employeeId (Employee identifier from Employee entity as mentioned by vikas). By doing this you can have one to many kind of relationship.

cheers...

Rohan Hanumante wrote:

Kavya Balaji wrote:

Hi All

I have an employee table, that creates a list of all employees created in the application. I create a listing entity where all the employees assigned to some senior employee. To create database for the same, how should I design my db for Team listing. My entity attributes has one to many relation among them


Hi Kavya,


You can create one entity "Managers" having attribute id, managerId (Employee identifier), employeeId (Employee identifier from Employee entity as mentioned by vikas). By doing this you can have one to many kind of relationship.

cheers...

Thanks Rohan. I do not have a managerId, I have only the employeeId. I need to save the employeeId as senior  employee and junior employee. Is that possible? 


Hi Kavya,

There is no need of manager Id. As suggested by Rohan in attribute ManagerId, you will insert the employee Id of senior employee(manager). Means type of ManagerId will Employee Identifier.

Thanks.

Kavya Balaji wrote:

Rohan Hanumante wrote:

Kavya Balaji wrote:

Hi All

I have an employee table, that creates a list of all employees created in the application. I create a listing entity where all the employees assigned to some senior employee. To create database for the same, how should I design my db for Team listing. My entity attributes has one to many relation among them


Hi Kavya,


You can create one entity "Managers" having attribute id, managerId (Employee identifier), employeeId (Employee identifier from Employee entity as mentioned by vikas). By doing this you can have one to many kind of relationship.

cheers...

Thanks Rohan. I do not have a managerId, I have only the employeeId. I need to save the employeeId as senior  employee and junior employee. Is that possible? 


HI Kavya,

Vikas had mentioned in the comments.

Cheers...


Hi Kavya,

Aside from the good suggestions above, if you don't want to add a ManagerId to your Employee you could create a ManagerEmployee Entity, that has two Employee Ids, one called SeniorEmployeeId and one called JuniorEmployeeId. Thus you can create your 1:n relationship. If you want to enforce the 1:n relationship (instead of allowing n:n), you can put a unique Index on JuniorEmployeeId.

Note however, that this is just basic data modelling, and has little to do with OutSystems. So the answer to your question "is this possible in OutSystems" is "yes", as in OutSystems you can do any data modelling you can also do manually or with other tools in a database.

Kilian Hekhuis wrote:

Hi Kavya,

Aside from the good suggestions above, if you don't want to add a ManagerId to your Employee you could create a ManagerEmployee Entity, that has two Employee Ids, one called SeniorEmployeeId and one called JuniorEmployeeId. Thus you can create your 1:n relationship. If you want to enforce the 1:n relationship (instead of allowing n:n), you can put a unique Index on JuniorEmployeeId.

Note however, that this is just basic data modelling, and has little to do with OutSystems. So the answer to your question "is this possible in OutSystems" is "yes", as in OutSystems you can do any data modelling you can also do manually or with other tools in a database.

Thank you Kilian  Rohan and vikas. My issue is now resolved.