Free cookie consent management tool by TermsFeed Policy Generator

Changeset 905


Ignore:
Timestamp:
12/04/08 16:49:55 (16 years ago)
Author:
svonolfe
Message:

Implemented user adapter (#372)

Location:
trunk/sources
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/PermissionOwnerAdapter.cs

    r899 r905  
    3434     new dsHiveServerTableAdapters.PermissionOwnerTableAdapter();
    3535
     36    private PermissionOwner Convert(dsHiveServer.PermissionOwnerRow row,
     37      PermissionOwner permOwner) {
     38      if (row != null && permOwner != null) {
     39        permOwner.PermissionOwnerId = row.PermissionOwnerId;
     40
     41        if (!row.IsNameNull())
     42          permOwner.Name = row.Name;
     43        else
     44          permOwner.Name = String.Empty;
     45
     46        return permOwner;
     47      } else
     48        return null;
     49    }
     50
     51    private dsHiveServer.PermissionOwnerRow Convert(PermissionOwner permOwner,
     52      dsHiveServer.PermissionOwnerRow row) {
     53      if (row != null && permOwner != null) {
     54        row.PermissionOwnerId = permOwner.PermissionOwnerId;
     55        row.Name = permOwner.Name;
     56
     57        return row;
     58      } else
     59        return null;
     60    }
     61
    3662    public void UpdatePermissionOwner(PermissionOwner permOwner) {
    3763      if (permOwner != null) {
     
    5783    internal bool FillPermissionOwner(PermissionOwner permOwner) {
    5884      if (permOwner != null) {
     85        dsHiveServer.PermissionOwnerDataTable data =
     86          adapter.GetDataById(permOwner.PermissionOwnerId);
     87        if (data.Count == 1) {
     88          dsHiveServer.PermissionOwnerRow row =
     89            data[0];
     90          Convert(row, permOwner);
     91
    5992          return true;
     93        }
    6094      }
    6195
     
    6397    }
    6498
    65     public PermissionOwner GetPermissionOwnerById(long resourceId) {
    66       throw new NotImplementedException();
     99    public PermissionOwner GetPermissionOwnerById(long permOwnerId) {
     100      PermissionOwner permOwner = new PermissionOwner();
     101      permOwner.PermissionOwnerId = permOwnerId;
     102
     103      if (FillPermissionOwner(permOwner))
     104        return permOwner;
     105      else
     106        return null;
    67107    }
    68108
    69109    public ICollection<PermissionOwner> GetAllPermissionOwners() {
    70       throw new NotImplementedException();
     110      ICollection<PermissionOwner> allPermissionOwners =
     111        new List<PermissionOwner>();
     112
     113      dsHiveServer.PermissionOwnerDataTable data =
     114          adapter.GetData();
     115
     116      foreach (dsHiveServer.PermissionOwnerRow row in data) {
     117        PermissionOwner permOwner = new PermissionOwner();
     118        Convert(row, permOwner);
     119        allPermissionOwners.Add(permOwner);
     120      }
     121
     122      return allPermissionOwners;
    71123    }
    72124
  • trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/UserAdapter.cs

    r899 r905  
    6868
    6969    public void UpdateUser(User user) {
    70       throw new NotImplementedException();
     70      if (user != null) {
     71        permOwnerAdapter.UpdatePermissionOwner(user);
     72
     73        dsHiveServer.HiveUserDataTable data =
     74          adapter.GetDataById(user.PermissionOwnerId);
     75
     76        dsHiveServer.HiveUserRow row;
     77        if (data.Count == 0) {
     78          row = data.NewHiveUserRow();
     79          row.PermissionOwnerId = user.PermissionOwnerId;
     80          data.AddHiveUserRow(row);
     81        } else {
     82          row = data[0];
     83        }
     84
     85        Convert(user, row);
     86
     87        adapter.Update(data);
     88      }
    7189    }
    7290
    7391    public User GetUserById(long userId) {
    74       throw new NotImplementedException();
     92      User user = new User();
     93
     94      dsHiveServer.HiveUserDataTable data =
     95          adapter.GetDataById(userId);
     96      if (data.Count == 1) {
     97        dsHiveServer.HiveUserRow row =
     98          data[0];
     99        Convert(row, user);
     100
     101        return user;
     102      } else {
     103        return null;
     104      }
    75105    }
    76106
    77107    public User GetUserByName(String name) {
    78       throw new NotImplementedException();
     108      User user = new User();
     109
     110      dsHiveServer.HiveUserDataTable data =
     111          adapter.GetDataByName(name);
     112      if (data.Count == 1) {
     113        dsHiveServer.HiveUserRow row =
     114          data[0];
     115        Convert(row, user);
     116
     117        return user;
     118      } else {
     119        return null;
     120      }
    79121    }
    80122
    81123    public ICollection<User> GetAllUsers() {
    82       throw new NotImplementedException();
     124      ICollection<User> allUsers =
     125        new List<User>();
     126
     127      dsHiveServer.HiveUserDataTable data =
     128          adapter.GetData();
     129
     130      foreach (dsHiveServer.HiveUserRow row in data) {
     131        User user = new User();
     132        Convert(row, user);
     133        allUsers.Add(user);
     134      }
     135
     136      return allUsers;
    83137    }
    84138
    85139    public bool DeleteUser(User user) {
    86       throw new NotImplementedException();
     140      //referential integrity will delete the client object
     141      return permOwnerAdapter.DeletePermissionOwner(user);
    87142    }
    88143
  • trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/dsHiveServer.Designer.cs

    r845 r905  
    30253025        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    30263026        private void InitCommandCollection() {
    3027             this._commandCollection = new global::System.Data.SqlClient.SqlCommand[2];
     3027            this._commandCollection = new global::System.Data.SqlClient.SqlCommand[3];
    30283028            this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
    30293029            this._commandCollection[0].Connection = this.Connection;
     
    30353035            this._commandCollection[1].CommandType = global::System.Data.CommandType.Text;
    30363036            this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Id", global::System.Data.SqlDbType.BigInt, 8, global::System.Data.ParameterDirection.Input, 0, 0, "PermissionOwnerId", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
     3037            this._commandCollection[2] = new global::System.Data.SqlClient.SqlCommand();
     3038            this._commandCollection[2].Connection = this.Connection;
     3039            this._commandCollection[2].CommandText = "SELECT     HiveUser.PermissionOwnerId, HiveUser.Password\r\nFROM         HiveUser I" +
     3040                "NNER JOIN\r\n                      PermissionOwner ON HiveUser.PermissionOwnerId =" +
     3041                " PermissionOwner.PermissionOwnerId\r\nWHERE     (PermissionOwner.Name = @Name)";
     3042            this._commandCollection[2].CommandType = global::System.Data.CommandType.Text;
     3043            this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Name", global::System.Data.SqlDbType.VarChar, 18, global::System.Data.ParameterDirection.Input, 0, 0, "Name", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
    30373044        }
    30383045       
     
    30783085            this.Adapter.SelectCommand = this.CommandCollection[1];
    30793086            this.Adapter.SelectCommand.Parameters[0].Value = ((long)(Id));
     3087            dsHiveServer.HiveUserDataTable dataTable = new dsHiveServer.HiveUserDataTable();
     3088            this.Adapter.Fill(dataTable);
     3089            return dataTable;
     3090        }
     3091       
     3092        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     3093        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
     3094        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, false)]
     3095        public virtual int FillByName(dsHiveServer.HiveUserDataTable dataTable, string Name) {
     3096            this.Adapter.SelectCommand = this.CommandCollection[2];
     3097            if ((Name == null)) {
     3098                this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value;
     3099            }
     3100            else {
     3101                this.Adapter.SelectCommand.Parameters[0].Value = ((string)(Name));
     3102            }
     3103            if ((this.ClearBeforeFill == true)) {
     3104                dataTable.Clear();
     3105            }
     3106            int returnValue = this.Adapter.Fill(dataTable);
     3107            return returnValue;
     3108        }
     3109       
     3110        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     3111        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
     3112        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
     3113        public virtual dsHiveServer.HiveUserDataTable GetDataByName(string Name) {
     3114            this.Adapter.SelectCommand = this.CommandCollection[2];
     3115            if ((Name == null)) {
     3116                this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value;
     3117            }
     3118            else {
     3119                this.Adapter.SelectCommand.Parameters[0].Value = ((string)(Name));
     3120            }
    30803121            dsHiveServer.HiveUserDataTable dataTable = new dsHiveServer.HiveUserDataTable();
    30813122            this.Adapter.Fill(dataTable);
  • trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/dsHiveServer.xsd

    r845 r905  
    230230                </SelectCommand>
    231231              </DbSource>
     232              <DbSource ConnectionRef="HiveServerConnectionString (Settings)" DbObjectName="HiveServer.dbo.HiveUser" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillByName" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetDataByName" GeneratorSourceName="FillByName" GetMethodModifier="Public" GetMethodName="GetDataByName" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataByName" UserSourceName="FillByName">
     233                <SelectCommand>
     234                  <DbCommand CommandType="Text" ModifiedByUser="true">
     235                    <CommandText>SELECT     HiveUser.PermissionOwnerId, HiveUser.Password
     236FROM         HiveUser INNER JOIN
     237                      PermissionOwner ON HiveUser.PermissionOwnerId = PermissionOwner.PermissionOwnerId
     238WHERE     (PermissionOwner.Name = @Name)</CommandText>
     239                    <Parameters>
     240                      <Parameter AllowDbNull="true" AutogeneratedName="Name" ColumnName="Name" DataSourceName="HiveServer.dbo.PermissionOwner" DataTypeServer="varchar(18)" DbType="AnsiString" Direction="Input" ParameterName="@Name" Precision="0" ProviderType="VarChar" Scale="0" Size="18" SourceColumn="Name" SourceColumnNullMapping="false" SourceVersion="Current" />
     241                    </Parameters>
     242                  </DbCommand>
     243                </SelectCommand>
     244              </DbSource>
    232245            </Sources>
    233246          </TableAdapter>
     
    303316          <xs:complexType>
    304317            <xs:sequence>
    305               <xs:element name="ResourceId" msdata:ReadOnly="true" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" msprop:Generator_UserColumnName="ResourceId" msprop:Generator_ColumnVarNameInTable="columnResourceId" msprop:Generator_ColumnPropNameInRow="ResourceId" msprop:Generator_ColumnPropNameInTable="ResourceIdColumn" type="xs:long" />
    306               <xs:element name="Name" msprop:Generator_UserColumnName="Name" msprop:Generator_ColumnVarNameInTable="columnName" msprop:Generator_ColumnPropNameInRow="Name" msprop:Generator_ColumnPropNameInTable="NameColumn" minOccurs="0">
     318              <xs:element name="ResourceId" msdata:ReadOnly="true" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" msprop:Generator_UserColumnName="ResourceId" msprop:Generator_ColumnPropNameInRow="ResourceId" msprop:Generator_ColumnVarNameInTable="columnResourceId" msprop:Generator_ColumnPropNameInTable="ResourceIdColumn" type="xs:long" />
     319              <xs:element name="Name" msprop:Generator_UserColumnName="Name" msprop:Generator_ColumnPropNameInRow="Name" msprop:Generator_ColumnVarNameInTable="columnName" msprop:Generator_ColumnPropNameInTable="NameColumn" minOccurs="0">
    307320                <xs:simpleType>
    308321                  <xs:restriction base="xs:string">
     
    314327          </xs:complexType>
    315328        </xs:element>
    316         <xs:element name="Client" msprop:Generator_UserTableName="Client" msprop:Generator_RowDeletedName="ClientRowDeleted" msprop:Generator_TableClassName="ClientDataTable" msprop:Generator_RowChangedName="ClientRowChanged" msprop:Generator_RowClassName="ClientRow" msprop:Generator_RowChangingName="ClientRowChanging" msprop:Generator_RowEvArgName="ClientRowChangeEvent" msprop:Generator_RowEvHandlerName="ClientRowChangeEventHandler" msprop:Generator_TablePropName="Client" msprop:Generator_TableVarName="tableClient" msprop:Generator_RowDeletingName="ClientRowDeleting">
     329        <xs:element name="Client" msprop:Generator_UserTableName="Client" msprop:Generator_RowDeletedName="ClientRowDeleted" msprop:Generator_RowChangedName="ClientRowChanged" msprop:Generator_RowClassName="ClientRow" msprop:Generator_RowChangingName="ClientRowChanging" msprop:Generator_RowEvArgName="ClientRowChangeEvent" msprop:Generator_RowEvHandlerName="ClientRowChangeEventHandler" msprop:Generator_TableClassName="ClientDataTable" msprop:Generator_TableVarName="tableClient" msprop:Generator_RowDeletingName="ClientRowDeleting" msprop:Generator_TablePropName="Client">
    317330          <xs:complexType>
    318331            <xs:sequence>
    319               <xs:element name="ResourceId" msprop:Generator_UserColumnName="ResourceId" msprop:Generator_ColumnPropNameInRow="ResourceId" msprop:Generator_ColumnVarNameInTable="columnResourceId" msprop:Generator_ColumnPropNameInTable="ResourceIdColumn" type="xs:long" />
    320               <xs:element name="GUID" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="GUID" msprop:Generator_ColumnPropNameInRow="GUID" msprop:Generator_ColumnVarNameInTable="columnGUID" msprop:Generator_ColumnPropNameInTable="GUIDColumn" type="xs:string" minOccurs="0" />
    321               <xs:element name="CPUSpeed" msprop:Generator_UserColumnName="CPUSpeed" msprop:Generator_ColumnPropNameInRow="CPUSpeed" msprop:Generator_ColumnVarNameInTable="columnCPUSpeed" msprop:Generator_ColumnPropNameInTable="CPUSpeedColumn" type="xs:int" minOccurs="0" />
    322               <xs:element name="Memory" msprop:Generator_UserColumnName="Memory" msprop:Generator_ColumnPropNameInRow="Memory" msprop:Generator_ColumnVarNameInTable="columnMemory" msprop:Generator_ColumnPropNameInTable="MemoryColumn" type="xs:int" minOccurs="0" />
    323               <xs:element name="Login" msprop:Generator_UserColumnName="Login" msprop:Generator_ColumnPropNameInRow="Login" msprop:Generator_ColumnVarNameInTable="columnLogin" msprop:Generator_ColumnPropNameInTable="LoginColumn" type="xs:dateTime" minOccurs="0" />
    324               <xs:element name="Status" msprop:Generator_UserColumnName="Status" msprop:Generator_ColumnPropNameInRow="Status" msprop:Generator_ColumnVarNameInTable="columnStatus" msprop:Generator_ColumnPropNameInTable="StatusColumn" minOccurs="0">
     332              <xs:element name="ResourceId" msprop:Generator_UserColumnName="ResourceId" msprop:Generator_ColumnVarNameInTable="columnResourceId" msprop:Generator_ColumnPropNameInRow="ResourceId" msprop:Generator_ColumnPropNameInTable="ResourceIdColumn" type="xs:long" />
     333              <xs:element name="GUID" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="GUID" msprop:Generator_ColumnVarNameInTable="columnGUID" msprop:Generator_ColumnPropNameInRow="GUID" msprop:Generator_ColumnPropNameInTable="GUIDColumn" type="xs:string" minOccurs="0" />
     334              <xs:element name="CPUSpeed" msprop:Generator_UserColumnName="CPUSpeed" msprop:Generator_ColumnVarNameInTable="columnCPUSpeed" msprop:Generator_ColumnPropNameInRow="CPUSpeed" msprop:Generator_ColumnPropNameInTable="CPUSpeedColumn" type="xs:int" minOccurs="0" />
     335              <xs:element name="Memory" msprop:Generator_UserColumnName="Memory" msprop:Generator_ColumnVarNameInTable="columnMemory" msprop:Generator_ColumnPropNameInRow="Memory" msprop:Generator_ColumnPropNameInTable="MemoryColumn" type="xs:int" minOccurs="0" />
     336              <xs:element name="Login" msprop:Generator_UserColumnName="Login" msprop:Generator_ColumnVarNameInTable="columnLogin" msprop:Generator_ColumnPropNameInRow="Login" msprop:Generator_ColumnPropNameInTable="LoginColumn" type="xs:dateTime" minOccurs="0" />
     337              <xs:element name="Status" msprop:Generator_UserColumnName="Status" msprop:Generator_ColumnVarNameInTable="columnStatus" msprop:Generator_ColumnPropNameInRow="Status" msprop:Generator_ColumnPropNameInTable="StatusColumn" minOccurs="0">
    325338                <xs:simpleType>
    326339                  <xs:restriction base="xs:string">
     
    329342                </xs:simpleType>
    330343              </xs:element>
    331               <xs:element name="ClientConfigId" msprop:Generator_UserColumnName="ClientConfigId" msprop:Generator_ColumnPropNameInRow="ClientConfigId" msprop:Generator_ColumnVarNameInTable="columnClientConfigId" msprop:Generator_ColumnPropNameInTable="ClientConfigIdColumn" type="xs:long" minOccurs="0" />
    332               <xs:element name="NumberOfCores" msprop:Generator_UserColumnName="NumberOfCores" msprop:Generator_ColumnPropNameInRow="NumberOfCores" msprop:Generator_ColumnVarNameInTable="columnNumberOfCores" msprop:Generator_ColumnPropNameInTable="NumberOfCoresColumn" type="xs:int" minOccurs="0" />
     344              <xs:element name="ClientConfigId" msprop:Generator_UserColumnName="ClientConfigId" msprop:Generator_ColumnVarNameInTable="columnClientConfigId" msprop:Generator_ColumnPropNameInRow="ClientConfigId" msprop:Generator_ColumnPropNameInTable="ClientConfigIdColumn" type="xs:long" minOccurs="0" />
     345              <xs:element name="NumberOfCores" msprop:Generator_UserColumnName="NumberOfCores" msprop:Generator_ColumnVarNameInTable="columnNumberOfCores" msprop:Generator_ColumnPropNameInRow="NumberOfCores" msprop:Generator_ColumnPropNameInTable="NumberOfCoresColumn" type="xs:int" minOccurs="0" />
    333346            </xs:sequence>
    334347          </xs:complexType>
    335348        </xs:element>
    336         <xs:element name="HiveUser" msprop:Generator_UserTableName="HiveUser" msprop:Generator_RowDeletedName="HiveUserRowDeleted" msprop:Generator_TableClassName="HiveUserDataTable" msprop:Generator_RowChangedName="HiveUserRowChanged" msprop:Generator_RowClassName="HiveUserRow" msprop:Generator_RowChangingName="HiveUserRowChanging" msprop:Generator_RowEvArgName="HiveUserRowChangeEvent" msprop:Generator_RowEvHandlerName="HiveUserRowChangeEventHandler" msprop:Generator_TablePropName="HiveUser" msprop:Generator_TableVarName="tableHiveUser" msprop:Generator_RowDeletingName="HiveUserRowDeleting">
     349        <xs:element name="HiveUser" msprop:Generator_UserTableName="HiveUser" msprop:Generator_RowDeletedName="HiveUserRowDeleted" msprop:Generator_RowChangedName="HiveUserRowChanged" msprop:Generator_RowClassName="HiveUserRow" msprop:Generator_RowChangingName="HiveUserRowChanging" msprop:Generator_RowEvArgName="HiveUserRowChangeEvent" msprop:Generator_RowEvHandlerName="HiveUserRowChangeEventHandler" msprop:Generator_TableClassName="HiveUserDataTable" msprop:Generator_TableVarName="tableHiveUser" msprop:Generator_RowDeletingName="HiveUserRowDeleting" msprop:Generator_TablePropName="HiveUser">
    337350          <xs:complexType>
    338351            <xs:sequence>
    339               <xs:element name="PermissionOwnerId" msprop:Generator_UserColumnName="PermissionOwnerId" msprop:Generator_ColumnPropNameInRow="PermissionOwnerId" msprop:Generator_ColumnVarNameInTable="columnPermissionOwnerId" msprop:Generator_ColumnPropNameInTable="PermissionOwnerIdColumn" type="xs:long" />
    340               <xs:element name="Password" msprop:Generator_UserColumnName="Password" msprop:Generator_ColumnPropNameInRow="Password" msprop:Generator_ColumnVarNameInTable="columnPassword" msprop:Generator_ColumnPropNameInTable="PasswordColumn" minOccurs="0">
     352              <xs:element name="PermissionOwnerId" msprop:Generator_UserColumnName="PermissionOwnerId" msprop:Generator_ColumnVarNameInTable="columnPermissionOwnerId" msprop:Generator_ColumnPropNameInRow="PermissionOwnerId" msprop:Generator_ColumnPropNameInTable="PermissionOwnerIdColumn" type="xs:long" />
     353              <xs:element name="Password" msprop:Generator_UserColumnName="Password" msprop:Generator_ColumnVarNameInTable="columnPassword" msprop:Generator_ColumnPropNameInRow="Password" msprop:Generator_ColumnPropNameInTable="PasswordColumn" minOccurs="0">
    341354                <xs:simpleType>
    342355                  <xs:restriction base="xs:string">
     
    348361          </xs:complexType>
    349362        </xs:element>
    350         <xs:element name="PermissionOwner" msprop:Generator_UserTableName="PermissionOwner" msprop:Generator_RowDeletedName="PermissionOwnerRowDeleted" msprop:Generator_TableClassName="PermissionOwnerDataTable" msprop:Generator_RowChangedName="PermissionOwnerRowChanged" msprop:Generator_RowClassName="PermissionOwnerRow" msprop:Generator_RowChangingName="PermissionOwnerRowChanging" msprop:Generator_RowEvArgName="PermissionOwnerRowChangeEvent" msprop:Generator_RowEvHandlerName="PermissionOwnerRowChangeEventHandler" msprop:Generator_TablePropName="PermissionOwner" msprop:Generator_TableVarName="tablePermissionOwner" msprop:Generator_RowDeletingName="PermissionOwnerRowDeleting">
     363        <xs:element name="PermissionOwner" msprop:Generator_UserTableName="PermissionOwner" msprop:Generator_RowDeletedName="PermissionOwnerRowDeleted" msprop:Generator_RowChangedName="PermissionOwnerRowChanged" msprop:Generator_RowClassName="PermissionOwnerRow" msprop:Generator_RowChangingName="PermissionOwnerRowChanging" msprop:Generator_RowEvArgName="PermissionOwnerRowChangeEvent" msprop:Generator_RowEvHandlerName="PermissionOwnerRowChangeEventHandler" msprop:Generator_TableClassName="PermissionOwnerDataTable" msprop:Generator_TableVarName="tablePermissionOwner" msprop:Generator_RowDeletingName="PermissionOwnerRowDeleting" msprop:Generator_TablePropName="PermissionOwner">
    351364          <xs:complexType>
    352365            <xs:sequence>
    353               <xs:element name="PermissionOwnerId" msdata:ReadOnly="true" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" msprop:Generator_UserColumnName="PermissionOwnerId" msprop:Generator_ColumnPropNameInRow="PermissionOwnerId" msprop:Generator_ColumnVarNameInTable="columnPermissionOwnerId" msprop:Generator_ColumnPropNameInTable="PermissionOwnerIdColumn" type="xs:long" />
    354               <xs:element name="Name" msprop:Generator_UserColumnName="Name" msprop:Generator_ColumnPropNameInRow="Name" msprop:Generator_ColumnVarNameInTable="columnName" msprop:Generator_ColumnPropNameInTable="NameColumn" minOccurs="0">
     366              <xs:element name="PermissionOwnerId" msdata:ReadOnly="true" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" msprop:Generator_UserColumnName="PermissionOwnerId" msprop:Generator_ColumnVarNameInTable="columnPermissionOwnerId" msprop:Generator_ColumnPropNameInRow="PermissionOwnerId" msprop:Generator_ColumnPropNameInTable="PermissionOwnerIdColumn" type="xs:long" />
     367              <xs:element name="Name" msprop:Generator_UserColumnName="Name" msprop:Generator_ColumnVarNameInTable="columnName" msprop:Generator_ColumnPropNameInRow="Name" msprop:Generator_ColumnPropNameInTable="NameColumn" minOccurs="0">
    355368                <xs:simpleType>
    356369                  <xs:restriction base="xs:string">
  • trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/dsHiveServer.xss

    r845 r905  
    55     the code is regenerated.
    66</autogenerated>-->
    7 <DiagramLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ex:showrelationlabel="False" ViewPortX="-10" ViewPortY="-47" xmlns:ex="urn:schemas-microsoft-com:xml-msdatasource-layout-extended" xmlns="urn:schemas-microsoft-com:xml-msdatasource-layout">
     7<DiagramLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ex:showrelationlabel="False" ViewPortX="3" ViewPortY="-47" xmlns:ex="urn:schemas-microsoft-com:xml-msdatasource-layout-extended" xmlns="urn:schemas-microsoft-com:xml-msdatasource-layout">
    88  <Shapes>
    9     <Shape ID="DesignTable:Resource" ZOrder="2" X="31" Y="-16" Height="122" Width="194" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="58" />
    10     <Shape ID="DesignTable:Client" ZOrder="1" X="39" Y="137" Height="224" Width="176" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="160" />
    11     <Shape ID="DesignTable:HiveUser" ZOrder="5" X="480" Y="221" Height="122" Width="193" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="58" />
    12     <Shape ID="DesignTable:PermissionOwner" ZOrder="4" X="442" Y="66" Height="122" Width="242" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="58" />
     9    <Shape ID="DesignTable:Resource" ZOrder="4" X="31" Y="-16" Height="122" Width="194" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="58" />
     10    <Shape ID="DesignTable:Client" ZOrder="3" X="39" Y="137" Height="224" Width="176" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="160" />
     11    <Shape ID="DesignTable:HiveUser" ZOrder="2" X="336" Y="139" Height="139" Width="226" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="58" />
     12    <Shape ID="DesignTable:PermissionOwner" ZOrder="1" X="298" Y="-16" Height="122" Width="242" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="58" />
    1313  </Shapes>
    1414  <Connectors>
     
    2525      </RoutePoints>
    2626    </Connector>
    27     <Connector ID="DesignRelation:User_is_a_PermissionOwner" ZOrder="3" LineWidth="11">
     27    <Connector ID="DesignRelation:User_is_a_PermissionOwner" ZOrder="5" LineWidth="11">
    2828      <RoutePoints>
    2929        <Point>
    30           <X>521</X>
    31           <Y>188</Y>
     30          <X>438</X>
     31          <Y>106</Y>
    3232        </Point>
    3333        <Point>
    34           <X>521</X>
    35           <Y>221</Y>
     34          <X>438</X>
     35          <Y>139</Y>
    3636        </Point>
    3737      </RoutePoints>
  • trunk/sources/HeuristicLab.Hive.Server.Core/DbTestApp.cs

    r845 r905  
    3636      AutoRestart = true)]
    3737  class HiveDbTestApplication : ApplicationBase {
    38     public override void Run() {
     38    private void TestClientAdapter() {
    3939      IClientAdapter clientAdapter =
    4040        ServiceLocator.GetClientAdapter();
     
    4343      client.Login = DateTime.Now;
    4444      client.ClientId = Guid.NewGuid();
    45       clientAdapter.UpdateClient(client); 
     45      clientAdapter.UpdateClient(client);
    4646
    47       ClientInfo clientRead = 
     47      ClientInfo clientRead =
    4848        clientAdapter.GetClientById(client.ClientId);
    4949      Debug.Assert(
     
    5757      Debug.Assert(
    5858       clientRead != null &&
    59        client.ClientId == clientRead.ClientId && 
     59       client.ClientId == clientRead.ClientId &&
    6060       clientRead.CpuSpeedPerCore == 2000);
    6161
     
    6868      Debug.Assert(count - 1 == clients.Count);
    6969    }
     70
     71    private void TestUserAdapter() {
     72      IUserAdapter userAdapter =
     73        ServiceLocator.GetUserAdapter();
     74
     75      User user = new User();
     76      user.Name = "Stefan";
     77
     78      userAdapter.UpdateUser(user);
     79
     80      User userRead =
     81        userAdapter.GetUserById(user.PermissionOwnerId);
     82      Debug.Assert(
     83        userRead != null &&
     84        user.PermissionOwnerId == userRead.PermissionOwnerId);
     85
     86      user.Password = "passme";
     87      userAdapter.UpdateUser(user);
     88      userRead =
     89        userAdapter.GetUserByName(user.Name);
     90      Debug.Assert(
     91       userRead != null &&
     92       userRead.Name == user.Name &&
     93       userRead.Password == user.Password);
     94
     95      ICollection<User> users = userAdapter.GetAllUsers();
     96      int count = users.Count;
     97
     98      userAdapter.DeleteUser(user);
     99
     100      users = userAdapter.GetAllUsers();
     101      Debug.Assert(count - 1 == users.Count);
     102    }
     103
     104    public override void Run() {
     105      TestClientAdapter();
     106      TestUserAdapter();
     107    }
    70108  }
    71109}
  • trunk/sources/HeuristicLab.Hive.Server.Core/InternalInterfaces/DataAccess/IPermissionOwnerAdapter.cs

    r845 r905  
    4242    /// <param name="clientId"></param>
    4343    /// <returns></returns>
    44     PermissionOwner GetPermissionOwnerById(long resourceId);
     44    PermissionOwner GetPermissionOwnerById(long permOwnerId);
    4545
    4646    /// <summary>
Note: See TracChangeset for help on using the changeset viewer.