Skip to content

Inheritance/Subclassing #1

@cchamplin

Description

@cchamplin

We're trying to utilize your code to leverage inherited objects through a webservice. We are running into a number of problems. Our mapping setup is as follows

<class name="Person" abstract="true" table="People">
    <cache region="People" usage="read-only"/>
    <id name="Id">
      <generator class="identity"/>
    </id>
    <property name="FirstName"/>
    <property name="LastName"/>
      <set name="Addresses" table="Addresses" access="field.camelcase">
          <key column="PersonId"/>
          <one-to-many class="Address"/>
      </set>

    <joined-subclass table="Student" name="Student">
          <key column="PersonId"/>
          <property name="Smer" column="SmerEs"/>
    </joined-subclass>
      <joined-subclass table="Staff" name="Staff">
          <key column="PersonId"/>
          <property name="Mer" column="Larp"/>

      </joined-subclass>
  </class>
        public IQueryable<Student> Student
        {

            get { return ApplyExpansions<Student>(Session.Query<Student>()); }
        }

In our database structure we have the tables Student and Staff related to the People table. The service seems to serve this data fine when we add the IQueryable for Student and Staff to the NHibernateContext. The problem is when trying to add a reference to the webservice through .NET we get errors on meta data.

There was an error downloading 'http://localhost:17104/QueryService.svc/_vti_bin/ListData.svc/$metadata'.
The request failed with HTTP status 404: Not Found.
Metadata contains a reference that cannot be resolved: 'http://localhost:17104/QueryService.svc'.
The remote server returned an unexpected response: (405) Method Not Allowed.
The remote server returned an error: (405) Method Not Allowed.
If the service is defined in the current solution, try building the solution and adding the service reference again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions