Skip Headers

# Using the Default Table Generator at Run Time

Previous

Next

To create a `TableCreator` class in Java using the `DefaultTableGenerator`, use this procedure:

1. Create an instance of `DefaultTableGenerator`, passing in an instance of your TopLink project:

       DefaultTableGenerator myDefTblGen = new DefaultTableGenerator(toplinkProject);

2. Create a `TableCreator` instance:

   - If you want a `TableCreator` that can support any session, use:

         TableCreator myTblCre = myDefTblGen.generateDefaultTableCreator();

   - If you want a `TableCreator` customized for a specific TopLink session, use:

         TableCreator myTblCre = myDefTblGen.generateFilteredDefaultTableCreator(toplinkSession);

You can also configure TopLink to use the `DefaultTableGenerator` to automatically generate and execute a `TableCreator` at run time (see "Automatic Database Table Creation").