Re: Complex Hibernate mapping (or not?)



Snyke wrote:
Once again I'm running against a solid wall of errors, and my head
starts to hurt really badly with this one :-)
I have a bidirectional link between two classes

Account <=> User

this being a many-to-many relationship. Until now nothing fancy, but I
have a Class inbetween that manages accessrights called Privilge, this
just has two boolean values (read and write) that tell wether a user
can read or write to the account.

Account <-many-to-one-> Privilege <-one-to-many-> User

basically every Account-User combination has a Privilege.

Hi. I followed this Thread and triied to give it a check.
I downloaded your code and ran it. I need to create a class BaseVO.java as you didn't provide it. Here is what I put:

<BaseVO.java>
public class BaseVO {
private int id = -1;
private Privilege[] userPrivileges = null;

public int getId() {
return id;
}

public void setId(int i) {
id = i;
}

public Privilege[] getUserPrivileges() {
return userPrivileges;
}

public void setUserPrivileges(Privilege[] priv) {
userPrivileges = priv;
}
}
</BaseVO.java>

I am not sure the set/get on userPrivileges are in this class or not. But Hibernate was complaining there was no setter/getter for userPrivileges in UserAccount. I thought ot put it in BaseVo as it was not in your original UserAccount.java

Anyway, after creating the DB in mysql, the only output I have is:

classic factory

I don't have any error message. So I guess you might have a different DB than me. Here is my DB script:

<db_mysql>
CREATE TABLE accounts (
id int(11) NOT NULL,
`name` varchar(32) NOT NULL
);

CREATE TABLE privilege (
id int(11) NOT NULL auto_increment,
isread tinyint(4) NOT NULL,
iswrite tinyint(4) NOT NULL,
`user` int(11) NOT NULL,
account int(11) NOT NULL,
PRIMARY KEY (id)
);

CREATE TABLE users (
id int(11) NOT NULL auto_increment,
`name` varchar(32) NOT NULL,
`password` varchar(32) NOT NULL,
user_privileges int(11) NOT NULL,
PRIMARY KEY (id)
);

</db_mysql>

Note that MySQl (and many DBMS) have 'user', 'password' and 'name' reserved (so MySQl encloses them with backquotes). Maybe that's what is perturbing Hibernate. I am using hibernate 3.

--
JSC
.



Relevant Pages

  • Re: ASP.NET Impersonation / delegation
    ... If your security guys will not even allow delegation, ... Bruce - I think this is a major right to grant to the ASPNet account. ... I have included a description on SE_TCB_NAME privilege from one of the MS ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: ASP.NET Impersonation / delegation
    ... there will not be any security risk? ... The MS documention does not recommend SE_TCB_NAME privilege to a any account other than the default LocalSystem. ... Processes that require this privilege should use the LocalSystem account, which already includes this privilege, rather than using a separate user account with this privilege specially assigned. ... best alternative for impersonating an account that is specially created for ...
    (microsoft.public.win2000.developer)
  • Re: Adding a Privilege via LsaAddAccountRights()
    ... > Security snapin. ... This privilege was introduced with SP4. ... You can add ASPNET account there as well. ...
    (microsoft.public.platformsdk.security)
  • Re: impersonation fails on 2K server
    ... On W2K you need "Act as part of the Operating System" privilege to call ... Note that granting this level of privilege to a webserver identity is ... something you should consider with great care as it gives the account ... > details below and modify your configuration file appropriately. ...
    (microsoft.public.dotnet.framework)
  • Re: Verify a Windows Account
    ... > verify the user account and password is valid. ... I just tested it logging in to the local machine as ... > Windows XP, Windows 2003. ... The LocalSystem account has the privilege out of the ...
    (microsoft.public.dotnet.general)

Loading