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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:22:06+00:00 2026-06-13T10:22:06+00:00

I have 2 classes List @DatabaseTable(tableName = loginsList) public class LoginsList { @DatabaseField(columnName =

  • 0

I have 2 classes

List

@DatabaseTable(tableName = "loginsList")
public class LoginsList {

    @DatabaseField(columnName = "loginListID", generatedId = true)
    private int loginListID;
    @DatabaseField(columnName = "listName")
    private String listName;
    @DatabaseField(columnName = "listDescription")
    private String listDescription;
    @DatabaseField(columnName = "current")
    private boolean current;
    @DatabaseField(columnName = "sent")
    private boolean sent;

Login

@DatabaseTable(tableName = "login")
public class Login {
    @DatabaseField(columnName = "loginID", generatedId = true)
    private int loginID;
    @DatabaseField(columnName = "user", foreign=true)
    private User user;
    @DatabaseField(columnName = "loggedIn")
    private boolean loggedIn;
    @DatabaseField(columnName = "loginTime")
    private long loginTime;
    @DatabaseField(columnName = "logoutTime")
    private long logoutTime;
    @DatabaseField(columnName = "loginsList", foreign = true)
    private LoginsList loginsList;

I use ORMLite for the database. I want to know how can I get all logins for a list? I tried like this

tempLoginList = loginDao.queryForEq("loginsList", list);

where list is of type LoginsList and it is the list I want to get all the logins for, but it doesn’t work. How to do it with query builder?

  • 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-13T10:22:07+00:00Added an answer on June 13, 2026 at 10:22 am
    tempLoginList = loginDao.queryForEq("loginsList", list);
    

    That should work fine. Here’s a couple things to check for that may be getting in the way.

    • ORMLite stores an int in Login which is the loginListID field from the LoginsList. When you associate a list with a Login, it must already have been created in the database so its id has already been generated.

    • If you look at your query logs (turn on logging with something like the following log4j properties, you should see the associated query. You should be able to see the login id field being queried for. You need to make sure that it is correct.

      log4j.logger.com.j256.ormlite=DEBUG
      # to enable logging of arguments to all of the SQL calls
      # uncomment the following lines
      log4j.logger.com.j256.ormlite.stmt.mapped.BaseMappedStatement=TRACE
      #log4j.logger.com.j256.ormlite.stmt.mapped.MappedCreate=TRACE
      #log4j.logger.com.j256.ormlite.stmt.StatementExecutor=TRACE
      

    I have a lot of unit tests but not specifically around dao.queryForEq(...) and foreign fields. I just added them to the code base and they work fine. Here’s my log output which might help:

    [DEBUG] BaseMappedStatement insert data with statement 'INSERT INTO `foo` (`val` ,`equal` ,`null` ) VALUES (?,?,?)' and 3 args, changed 1 rows
    [TRACE] BaseMappedStatement insert arguments: [1231231, 0, null]
    [DEBUG] BaseMappedStatement assigned id '1' from keyholder to 'id' in Foo object
    [DEBUG] BaseMappedStatement insert data with statement 'INSERT INTO `foreign` (`foo_id` ) VALUES (?)' and 1 args, changed 1 rows
    [TRACE] BaseMappedStatement insert arguments: [1]
    [DEBUG] BaseMappedStatement assigned id '1' from keyholder to 'id' in Foreign object
    [DEBUG] StatementBuilder built statement SELECT * FROM `foreign` WHERE `foo_id` = 1 
    [DEBUG] BaseMappedStatement prepared statement 'SELECT * FROM `foreign` WHERE `foo_id` = 1 ' with 0 args
    [DEBUG] SelectIterator starting iterator @1781793025 for 'SELECT * FROM `foreign` WHERE `foo_id` = 1 '
    [DEBUG] SelectIterator closed iterator @1781793025 after 1 rows
    [DEBUG] StatementExecutor query of 'SELECT * FROM `foreign` WHERE `foo_id` = 1 ' returned 1 results
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two classes public class JobDataProvider { public List<Job> Get(int id){ List<Job> jobs
I have 3 classes public class Test { private List<Question> _questions; private string _text;
Concerning data binding I have these classes: public class Foo : List<Bar> { public
I have the following classes [XmlRoot] public class AList { public List<B> ListOfBs {get;
I have two classes: public class RichMan { public string ID {get;set;} List<Car> _cars=new
Let's say that I have classes like this: public class Parent { public int
I have 2 classes with this structure: class ClassA { String typeA; List<String> valuesA;
In my Android project I have 3 classes: 1st a List class contains a
I have classes that are structured like the following: public class Forecast { [Key]
I have classes generated from a WCF soap service. public partial class Job {

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.