All rules for Java classes and databases also apply to temporary databases and the model database:
Java-SQL columns of temporary tables contain byte string serializations of the Java instances.
A Java-SQL column is associated with the version of the specified class in the temporary database.
You can install Java classes in a temporary database, but they persist only as long as the temporary database persists.
The simplest way to provide Java classes for reference in temporary databases is to install Java classes in the model database. They are then present in any temporary database derived from the model.