Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. FluentNHibernate mapping - No Persister for... Please help.

FluentNHibernate mapping - No Persister for... Please help.

Scheduled Pinned Locked Moved C#
helpdatabasequestionlearning
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    Yoken
    wrote on last edited by
    #1

    Hi all, I would greatly appreciate any assistance on this, I have no idea what is wrong :( I have a program that runs through excel sheets and populates the following classes: Product > (contains) > Recipe > (contains multiple) > Material The population of the objects work 100%, but I keep getting a "No Persister for Product" error when trying to .SaveOrUpdate(product); Please go through the code examples and database structure below and let me know what I'm doing wrong. I've been battling for ages and simply can't find the right path. To confirm, I have included the mapping files as an embeded resource (this solved my previous problem). Much appreciated and thank you in advance! =================== Database structure: =================== -Products Table- Contains various fields, one of which is 'RecipeID' which links to the -Recipes Table-. One product can have one recipe -Recipes Table- Contains ID, PercentageInKg, and MaterialID which links to the -RawMaterials Table-. The RecipeID is not unique, if a recipe has 5 materials it will have eg. ID=223 for all 5 entries (as the 5 entries form part of 1 recipe), MeterialID to each unique material entry, and PercentageInKg for each MaterialID which is the amount for this specific recipe -RawMaterials Table- Contains ID, Name, and CostPerKg. The MaterialID is unique, listing specific raw materials and its cost per kg. ================= Class Structures: =================

    public class Product
    {
        public virtual int ProductID { get; set; }
        public virtual string Name { get; set; }
        public virtual decimal BatchSize { get; set; }
        public virtual decimal FormulaSG { get; set; }
        public virtual string Appearance { get; set; }
        public virtual string Smell { get; set; }
        public virtual decimal Yield { get; set; }
        public virtual string SolidsPercentage { get; set; }
        public virtual string pH { get; set; }
        public virtual string Viscosity { get; set; }
        public virtual string Colour { get; set; }
        public virtual string FoamDefinition { get; set; }
        public virtual DateTime CreatedDate { get; set; }
        public virtual Recipe Recipe { get; set; }
    
        #region Overrides
        public override bool Equals(object obj)
        {...}
    
        public override int GetHashCode()
        {...}
        #endregion
    }
    
    
    
    public class Recip
    
    Y 1 Reply Last reply
    0
    • Y Yoken

      Hi all, I would greatly appreciate any assistance on this, I have no idea what is wrong :( I have a program that runs through excel sheets and populates the following classes: Product > (contains) > Recipe > (contains multiple) > Material The population of the objects work 100%, but I keep getting a "No Persister for Product" error when trying to .SaveOrUpdate(product); Please go through the code examples and database structure below and let me know what I'm doing wrong. I've been battling for ages and simply can't find the right path. To confirm, I have included the mapping files as an embeded resource (this solved my previous problem). Much appreciated and thank you in advance! =================== Database structure: =================== -Products Table- Contains various fields, one of which is 'RecipeID' which links to the -Recipes Table-. One product can have one recipe -Recipes Table- Contains ID, PercentageInKg, and MaterialID which links to the -RawMaterials Table-. The RecipeID is not unique, if a recipe has 5 materials it will have eg. ID=223 for all 5 entries (as the 5 entries form part of 1 recipe), MeterialID to each unique material entry, and PercentageInKg for each MaterialID which is the amount for this specific recipe -RawMaterials Table- Contains ID, Name, and CostPerKg. The MaterialID is unique, listing specific raw materials and its cost per kg. ================= Class Structures: =================

      public class Product
      {
          public virtual int ProductID { get; set; }
          public virtual string Name { get; set; }
          public virtual decimal BatchSize { get; set; }
          public virtual decimal FormulaSG { get; set; }
          public virtual string Appearance { get; set; }
          public virtual string Smell { get; set; }
          public virtual decimal Yield { get; set; }
          public virtual string SolidsPercentage { get; set; }
          public virtual string pH { get; set; }
          public virtual string Viscosity { get; set; }
          public virtual string Colour { get; set; }
          public virtual string FoamDefinition { get; set; }
          public virtual DateTime CreatedDate { get; set; }
          public virtual Recipe Recipe { get; set; }
      
          #region Overrides
          public override bool Equals(object obj)
          {...}
      
          public override int GetHashCode()
          {...}
          #endregion
      }
      
      
      
      public class Recip
      
      Y Offline
      Y Offline
      Yoken
      wrote on last edited by
      #2

      Anybody? I feel the silence of the universe oppressing my code! oh nooooo! :)

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups