Create multiple tables for one class in ORMLite

Viewed 2473

I'm using ORMLite on Android and have the following question: Is it possible to create many tables based on a single Java class?

The tables should only differ in their names, and the access to them should be by name.

For example if I have a class:

public class Order{
    @DatabaseField
    public string Name;

    @DatabaseField
    public string Amount;
}

And I have a dynamic number of modules that can create orders. I want every module to have its own table, but all tables should have a similar schema.

I know I can add a field in the Order class that indicates the source module name, and have all the orders live in one table, but I was wondering if there's a way to separate the tables (for faster queries, faster deletion of orders from the same module and so on)

Thanks!

1 Answers
Related