I am actually fully stuck with the DataSource meaning and dont know how to match it into "Real" world!
Even if i now try to share some database tables - with my "main" server (because i have an existing jsf app running on a seam server) how should i get the oneToMany or manyToMany relationship to work as they are within another table ?
So my problem is that (i try to simplify as much as possible):
A User can have several roles or be in serveral groups !
Made my server entities with hibernate - which means the following:
this then produces several tables ...
Now i made two datasource out of that - one UserDS and one RoleDS !
How can i now make any component with SmartClient and those Datasources to assign the UserDS to one (or several) Roles ???
Do i need to make a 3rd DataSource ? and if yes - how does the Update of the data then happen by the SmartClient server ?
Do i need to make the mapping "manually" (in a custom datasource) ??
Do i need to rewrite the whole structure - to fit into a datasource (which would mean to write some converters - from / to Database) ?
Can someone point me to the right direction - how to use those DataSource(s) within such a "Real" world application (relationships) !!
Many Thanks
Even if i now try to share some database tables - with my "main" server (because i have an existing jsf app running on a seam server) how should i get the oneToMany or manyToMany relationship to work as they are within another table ?
So my problem is that (i try to simplify as much as possible):
A User can have several roles or be in serveral groups !
Made my server entities with hibernate - which means the following:
Code:
User.class private int id; private String name; ...... private Set<Groups> belongingGroups, private Set<Roles> userRoles; @ManyToMany (mappedBy="users", targetEntity=xxxxx.Group.class) public getBelongingGroups() @ManyToMany(mappedBy="users", targetEntity=xxxxx.Role.class) public getUserRoles() Role.class ..... @ManyToMany(targetEntity=com.amergy.cmt.client.client.model.server.User.class) @JoinTable(name="User_Role", joinColumns={ @JoinColumn(name="RoleID") }, inverseJoinColumns={ @JoinColumn(name="UserID") }) private java.util.Set<User> users = new HashMap.......
Code:
User (with all Fields from User) Role (with all Fields from Role) User_Role(with the UserId and the RoleID)
How can i now make any component with SmartClient and those Datasources to assign the UserDS to one (or several) Roles ???
Do i need to make a 3rd DataSource ? and if yes - how does the Update of the data then happen by the SmartClient server ?
Do i need to make the mapping "manually" (in a custom datasource) ??
Do i need to rewrite the whole structure - to fit into a datasource (which would mean to write some converters - from / to Database) ?
Can someone point me to the right direction - how to use those DataSource(s) within such a "Real" world application (relationships) !!
Many Thanks
Comment