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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:16:10+00:00 2026-05-16T02:16:10+00:00

I have started to use NHibernate 3.0 and PostgreSQL for a small project, so

  • 0

I have started to use NHibernate 3.0 and PostgreSQL for a small project, so far the ride has been a little rough due to the NHibernate site being down and I’m sure this answer is on their website somewhere.

I have a database that has these two columns(of course there is more in the real table):

int ID
String Feature

now I’m using a FluentNHibernate to do the mapping so something like this:

public class MyEntityMap: ClassMap<MyEntity>
{
    public MyEntityMap()
    {
        Id(x => x.ID);
        Map(x => x.Feature);
    }
}

and a LINQ query to get out the data

var strucs = from str in session.Query<MyEntity>()
             where str.ID < 5
             select str;

The query will generate the proper SQL statement, well sort of. The problem is, because I have uppercase letters in my column names you have to wrap them in quotes but the generated SQL code looks something like this:

SELECT this_.ID as ID0_0_, this_.feature as feature0_0_, 
       FROM "MyEntity" this_ WHERE this_.ID < 5

Where the columns don’t have quotes around them. If I run this I get a “column this_.id” is not found etc.

Does anyone know how I can get NHibernate to wrap the column names in quotes?

EDIT: I can’t lowercase the column names as there are some columns that a third party program needs to be all in uppercase.

I tried adding .ExposeConfiguration(cfg => cfg.SetProperty(“hbm2ddl.keywords”,”auto-quote”) but it doesn’t seem to do anything.

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

    Since hbm2ddl.keywords is supposed to do this for you and it not working, I would suggest you to grab nhibernate source, and debug it with your project.

    Problably you can start with a breakpoint on SessionFactoryImpl.cs line 171

    if (settings.IsAutoQuoteEnabled)
    

    Take a look at method public static void QuoteTableAndColumns(Configuration configuration) on SchemaMetadataUpdater.cs

    Hope that helps.

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

Sidebar

Related Questions

Since I've started to use jQuery, I have been doing a lot more JavaScript
As part of my endless NHibernate-inspired DAL refactoring purgatory, I have started to use
I have just started learning NHibernate. Over the past few months I have been
I started using NHibernate this week (struggling). I have a small application with 3
I am programming a project in Objective-C and I have started to use Doxygen
We have started to use spring aop for cross cutting aspects of our application
I have recently started looking into Google Charts API for possible use within the
I've just started to use linq to sql and have run into a problem
I'm getting started on figuring out how to use RESTful design. I have this
I've just started using Java's enums in my own projects (I have to use

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.