Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6121553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:47:49+00:00 2026-05-23T15:47:49+00:00

I have an NHibernate mapping for a class called MediaStyle which includes this mapping:

  • 0

I have an NHibernate mapping for a class called MediaStyle which includes this mapping:

<bag name="EngineSteps" table="core.MediaStyleMediaPrintEngineStepAssoc" order-by="Sequence" lazy="true" cascade="none">
  <key column="MediaStyleId"/>
  <many-to-many class="MediaPrintEngineStep" lazy="proxy" />
</bag>

The class MediaPrintEngineStep is also mapped, and the class contains a property ‘Sequence’. Sequence isn’t stored on the table MediaPrintEngineStep maps to, but is contained on the association table used to map EngineSteps to MediaStyles.

Is there a way to have nHibernate map the ‘Sequence’ column from core.MediaStyleMediaPrintEngineStepAssoc into the empty property on the MediaPrintEngineStep class, or will I have to write additional code to get/set the sequence after it has been mapped? Unfortunately, refactoring the storage structure isn’t an option at the moment.

If I do have to write my own code to map it, what’s the best way to do so using the fewest database hits?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T15:47:49+00:00Added an answer on May 23, 2026 at 3:47 pm

    I found that it was easier to reset the sequence manually when I pulled a list, since the retrieval sorted them by sequence.

    Our insert and update run through stored procedures which update the sequence (and set several other flags elsewhere, which is why we chose stored procedures), so changes will get persisted.

    In this case it made more sense to reset the sequence after the objects were retrieved (given that we know the start index and other constraints on the sequence) than it did to re-architect part of our underlying object and service layers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the fallowing NHibernate-Mapping: <class name=Activity table=Activity lazy=false > <cache usage=read-write/> <id name=Id
I have declareted the fallowing Mapping for NHibernate: <class name=Sales table=Sales lazy=false > <id
I have a Hibernate mapping that looks something like this: <class name=MyEntity> <set name=scalarSet
I have a hibernate mapping as follows: <hibernate-mapping> <class name=kochman.elie.data.types.InvoiceTVO table=INVOICE> <id name=id column=ID>
I have the following mapping: <hibernate-mapping package=server.modules.stats.data> <class name=User table=user> <id name=id> <generator class=native></generator>
Lets say I have the following mapping: <hibernate-mapping package=mypackage> <class name=User table=user> <id name=id
NHibernate is driving me 'Nuts'!!! I have the following mapping. Which returns this error
Using NHibernate.Mapping.Attributes, I have a entity class with something like: [Class] public class EntityA
I have an class which has a collection, mapped as a bag in my
I have a class called Entry. This class as a collection of strings called

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.