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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:47:44+00:00 2026-05-13T20:47:44+00:00

I’m working with DataNucleus as part of a Google App Engine project and I’m

  • 0

I’m working with DataNucleus as part of a Google App Engine project and I’m having a bit of trouble with columns in persistence.

@PrimaryKey(column = "user_id")
@Column(name = "user_id")
@Persistent(name = "user_id", column = "user_id", valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key m_id;

@Column(name = "user_name")
@Persistent(name = "user_name", column = "user_name")
private String m_userName;

If you can’t tell, I’m trying to name the column something different than the name of the variable because I have two naming conventions (one works better in Java, one works better in SQL). Anyway, I’ve tried all variations of those marker annotations but the DataNucleus enhancer refuses to honor any of them, so when I run a query like this:

Query q = pm.newQuery(User.class,
                      "user_name == _username");

I always get an error like this:

org.datanucleus.store.appengine.FatalNucleusUserException: Unexpected expression type while parsing query. Are you certain that a field named user_name exists on your object?

Of course, when a run a query like this:

Query q = pm.newQuery(User.class,
                      "m_userName == _username");

…everything just works great. So, there would be a field named user_name if any of those annotations were honored, but they’re clearly not.

SO my question is: Is there any way to decouple the tokens I use in the query from the name of the field? I’m looking for the ability to change the names of the fields without having to edit the queries by hand.

NOTE: I would sooner just use my SQL naming conventions in the Java classes than write the hideous amounts of XML by hand, so this has to be done with the annotations.

  • 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-13T20:47:45+00:00Added an answer on May 13, 2026 at 8:47 pm

    No idea of the talk of SQL, you’re using GAE/J hence BigTable and not an RDBMS so SQL just won’t work. @Column likely does nothing since it is for ORM. Here you’re using JDOQLas the query language, so you use field names … since it is an Object-Oriented query language. This is NOT SQL. You detest “this” ? JDOQL uses Java syntax, hence “this” makes lots of sense.

    If you really want to have a type-safe query extension that allows refactoring then QueryDSL provides JDOQL for use with DataNucleus.

    PS The DataNucleus enhancer has nothing to do with column names. It simply adds on extra methods for detecting updates to fields, as per the JDO spec.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
We're building an app, our first using Rails 3, and we're having to build
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I am writing an app with both english and french support. The app requests
I am using Paperclip to handle profile photo uploads in my app. They upload
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I'm making a simple page using Google Maps API 3. My first. One marker
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
That's pretty much it. I'm using Nokogiri to scrape a web page what has

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.