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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:49:57+00:00 2026-06-17T14:49:57+00:00

I have tables A, B, C, D, E and I’m doing inner join across

  • 0

I have tables A, B, C, D, E and I’m doing inner join across them.
I need only partial data from results. For example, I need A.name column, D.phoneNumber column.

I’m using the method join().

How should I handle the result? Should I go through all my classes, to get all the data I need? If yes, what is a simple way to do this, because going through all of that seems a bit complicated.

Should I create a class just for result and somehow map the result to it?

  • 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-06-17T14:49:58+00:00Added an answer on June 17, 2026 at 2:49 pm

    According to the ORMlite documentation you can only use join statement with the tables connected via foreign object field.

    So the first approach as I see it is to use foreign object and retreive all the values you need. For example if you query you tables A and B with

    QueryBuilder<A, Integer> aqb = aDao.queryBuilder();
    QueryBuilder<B, Integer> bqb = bDao.queryBuilder();
    List<A> results = aqb.join(bqb).query();
    
    for (A a : results){
        String name = a.getName();
        String phone = a.getB().getPhone();
    }
    

    whereas A and B classes looks something like this:

    ....
    public class A{
    ....
        @DatabaseField
        private String name;
    
        @DatabaseField(foreign = true, foreignAutoRefresh = true)
        private B b;
    ....        
        public B getB(){
            return b;
        }
    ....
        public String getName(){
            return name;
        }
    }
    
    ....
    public class B{
    ....
        @DatabaseField
        private String phone;
    
        public String getPhone(){
            return phone;
        }
    }
    

    I’m not sure about exactly this code will work, I just wanted to describe the idea.

    As I know you can’t query for the multiple tables at once.

    See the related ORMLite documentation.
    Join statements have been supported since version 4.42 of the library.

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

Sidebar

Related Questions

I have tables like Person{id, name, dob} employee{id, company_name, joining_date}. I need to join
Our client's request is to have tables in PDF with rounded corner. I only
I have tables like this: from sqlalchemy import Column, Integer, select from sqlalchemy.ext.declarative import
I have tables with listings, categories and one that maps them to each other.
I have tables & data like this: venues table contains : id +----+---------+ |
I have tables of data samples, with a timestamp and some data. Each table
I have tables of reviews, venues and users. I currently have a _review.html.erb partial
I have tables like this fake ones: data: id type month value 1 1
I have tables with this type of datetime: 2010-09-16 00:32:41.960' CreatedDate column. I need
I have tables for dogs, cats , horses containing rows of information about them

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.