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 6086717
In Process

The Archive Base Latest Questions

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

I have a class for a user entity. One of the properties is the

  • 0

I have a class for a user entity. One of the properties is the user’s password (a hash, actually). I made it a string (streamlined code):

public class User
{
    public virtual int Id { get; set; }
    public virtual string Password { get; set; }
}

There’s also a Fluent NHibernate mapping (streamlined code):

public class UserMap : ClassMap<User>
{
    public UserMap()
    {
        Table("users");
        Id(x => x.Id).GeneratedBy.Sequence("users_id_seq");
        Map(x => x.Password); // what do I put here???
    }
}

The database column is of bytea data type on PostgreSQL. The above mapping doesn’t work, because the property is string (text). What should I do?

  • 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-23T11:47:16+00:00Added an answer on May 23, 2026 at 11:47 am

    you can Make Password a public property, which is only used to reference to the underlying private property HashedPassword.
    something like so:

    protected virtual byte[] /*or whatever the type is*/ HashedPassword {get; set;}
    public virtual string Password
    get
    {
    return (string)(HashedPassword); //or however you want to cast it to string...
    }
    set
    //...

    you can then tell fluent nHib to ignore your Password property.

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

Sidebar

Related Questions

I have simple User entity: public class User { public virtual int Id {
it's possible to have one entity object (class, e.g. User) for more entity models
I have two classes, user and role, defined as: public class User : Entity
I have a class: public class User { public virtual int Id { get;
I have this Class: public class User { public string id{ get; set; }
I have the following entity public class DocumentHistory { public string Name { get;
I have a User class which have a One-to-One association with another entity Result
I have an entity loaded by Hibernate (via EntityManager ): User u = em.load(User.class,
I have the following two entities: @Entity class Relation{ @ManyToOne private User user; //some
I have a class User with one field called birthDate which is a java.sql.Date

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.