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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:37:57+00:00 2026-05-30T23:37:57+00:00

I have used the HelloAndroid example of the OrmLite and modified it according to

  • 0

I have used the HelloAndroid example of the OrmLite and modified it according to my requirements and it works perfectly fine.

But then I added another Bean(POJO with proper annotations) and also updated my Config.txt file for the new table Added like this

# --table-start--
dataClass=com.example.helloandroid.SchoolDataBean

@DatabaseField(generatedId = true)
tableName=schooltable
# --table-fields-start--

# --field-start--
fieldName=rollNo
generatedId=true
# --field-end--

# --field-start--
fieldName=name
indexName=simpledata_string_idx
# --field-end--

# --field-start--
fieldName=gender
# --field-end--

# --field-start--
fieldName=presence
# --field-end--

# --table-fields-end--
# --table-end--

# --table-start--
dataClass=com.example.helloandroid.CompanyDataBean

@DatabaseField(generatedId = true)
tableName=companytable
# --table-fields-start--

# --field-start--
fieldName=companyId
generatedId=true
# --field-end--

# --field-start--
fieldName=name
indexName=simpledata_string_idx
# --field-end--

# --field-start--
fieldName=designation
# --field-end--

# --field-start--
fieldName=annualPay
# --field-end--

# --table-fields-end--
# --table-end--

Similar to the first table i have added the second table, i believe that there is something I am doing wrong with the Config class itself.

The Exception says this

java.sql.SQLException: Could not find declared field with name 'companyId' for class com.example.helloandroid.SchoolDataBean

There must be some way to tell the compiler that the first table has ended and the new table is to be read now, as its reading the second table’s column name in the first table.

public class CompanyDataBean {

    //id is generated by the database and set on the object automagically
    @DatabaseField(generatedId = true)
    int companyId;
    @DatabaseField(index = true)
    String name;
    @DatabaseField
    String designation;
    @DatabaseField
    String annualPay;

    public CompanyDataBean() {
    }

    public CompanyDataBean(int companyId,String name, String designation, String annualPay){
        this.companyId=companyId;
        this.name=name;
        this.designation=designation;
        this.annualPay=annualPay;
    }   
}

Thats how my BEAN looks like.
thanks.

  • 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-30T23:37:59+00:00Added an answer on May 30, 2026 at 11:37 pm

    I suspect that there is some syntax error in your configuration file that isn’t immediately obvious in your cut and paste. I would highly recommend that you don’t generate this file by hand. You need to remove these lines to start.

    @DatabaseField(generatedId = true)
    

    Aside from those, I don’t see any problems with the file although you need to make sure that all of the # lines are not indented. If you post the actual file to http://pastebin.com/ and edit your question with the URL, maybe we can help more.

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

Sidebar

Related Questions

I have used ajax in the code which works perfectly and give me json
i have used zend paginator in my app its working fine the way its
I have used microsoft system.security.cryptography to make md5 in c# application but I need
I have used following code to add three variables but instead of adding these
I have used initialization lists a great deal in my C++ programs but wasn't
I have used Broadcast receiver when it restarts it shows the launcher screen but
Have used google maps dozens of times but cannot get around this one. Doing
I have used Jetty in the past but I have little experience with jWebSocket.
i have used a piece of jQuery to highlight the search results, it works
I have used FCKeditor in my project. It worked fine before i add url

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.