114 Primary interfaces and classes interface Extent +iterator(
114 Primary interfaces and classes interface Extent +iterator( ):Iterator +hasSubclasses( ):boolean +getCandidateClass( ):Class +getPersistenceManager( ):PersistenceManager +closeAll( ):void +close(it:Iterator)void Figure 6.3 UML for extent interface The extent interface (Figure 6.3) contains the following methods. boolean hasSubclasses() True is returned if subclasses were included in the call to getExtent(). Note that this does not mean that the extent necessarily contains any instances of subclasses. Consider the code extract below: Extent e = pm.getExtent(BusinessPartner.class, true); System.out.println(”Has Subclasses: ” + e.hasSubclasses()); The output printed will be: Has Subclasses: true However, the extent will contain subclasses of BusinessPartner only if such persistent instances actually existed in the data store. If hasSubclasses() returns true, the extent can be considered complete (any persistent instances of subclasses will be present). If false is returned, the extent might not be complete. Class getCandidateClass() This method returns the class descriptor of the candidate class (the class identified in the call to the persistence manager s getExtent() method). The example below uses this to determine further information about an extent. public void printExtentInfo(Extent e) { System.out.println(”Candidate Class: ” + e.getCandidateClass().getName()); System.out.println(”Has Subclasses: ” + e.hasSubClasses()); } If invoked with the extent of BusinessPartner constructed above, the output would be:
Note: If you are looking for best hosting provider to host and run your tomcat application check Astra tomcat hosting services