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

  • Home
  • SEARCH
  • 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 6977135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:35:12+00:00 2026-05-27T17:35:12+00:00

I use ormlite with android and I’ve some poco class. Example : public class

  • 0

I use ormlite with android and I’ve some poco class.

Example :

public class TableName {
  @DatabaseField(id = true)
  public Integer id;

  @DatabaseField
  public String prop;
}

I want to create sometimes

QueryBuilder<TableName, Integer> qb = dao.queryBuilder();
qb.where().eq("prop", "value");

I’d like to validate the “prop” string without using constants in my poco class (like PROPNAME). Do you know a efficiant way to do this ? (without heavy load stuff like reflexion).

I’d really like code validation.

Regards

  • 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-27T17:35:13+00:00Added an answer on May 27, 2026 at 5:35 pm

    The ORMLite documentation organizes it this way, to avoid string literals everywhere:

    public class TableName {
      public static final String FIELD_ID = "id";
      public static final String FIELD_PROP = "prop";
    
      @DatabaseField(id = true)
      public Integer id;
    
      @DatabaseField
      public String prop;
    }
    
    QueryBuilder<TableName, Integer> qb = dao.queryBuilder();
    qb.where().eq(TableName.FIELD_PROP, "value");
    

    Internally ORMLite uses reflection when you pass this string in, so it is unavoidable when using this library.

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

Sidebar

Related Questions

I'm developing an application for Android, and have tried to use ORMLite, but the
Use these 2 persistent CFCs for example: // Cat.cfc component persistent=true { property name=id
Use case: I've just entered insert mode, and typed some text. Now I want
use Rack::Static, :urls => ['/stylesheets', '/images'], :root => 'public' run proc { |env| [200,
Use Case I need to package up our kml which is in a String
I am programming an Android app and using ormLite for the database. I want
I've got a relatively simple class that is primarily backed by a Map<String,String> .
Use case example: Client A comes to request sales information, enters their zip code
Use Eclipse Classic with ADT plugin. Tried to make project from existing example of
Use Memcache php class to interact with the memcached. At the beginning all works

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.