當前位置: 首頁>>代碼示例>>Java>>正文


Java FetchType.DEFAULT屬性代碼示例

本文整理匯總了Java中org.netbeans.modules.j2ee.persistence.entitygenerator.EntityRelation.FetchType.DEFAULT屬性的典型用法代碼示例。如果您正苦於以下問題:Java FetchType.DEFAULT屬性的具體用法?Java FetchType.DEFAULT怎麽用?Java FetchType.DEFAULT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.netbeans.modules.j2ee.persistence.entitygenerator.EntityRelation.FetchType的用法示例。


在下文中一共展示了FetchType.DEFAULT屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: generateEntityClass

/**
 * Generates entity classes for given tables.
 *
 * @param project project where the classes should be generated.
 * @param location source location.
 * @param packageName name of the package where the classes should be generated.
 * @param tableNames names of the tables.
 * @param dbconn connection to the DB with the tables.
 * @param unit persistence unit to add the generated classes into
 * @return entity class that corresponds to the specified table and names
 * of the entity classes for related tables (if <code>relatedTableNames</code>
 * parameter was non-<code>null</code>).
 */
private static String[] generateEntityClass(final Project project, SourceGroup location, String packageName, DatabaseConnection dbconn, List<String> tableNames, PersistenceUnit unit) {
    try {
        boolean regenTablesAttrs = "org.apache.derby.jdbc.EmbeddedDriver".equals(dbconn.getDriverClass()); // NOI18N
        EntitiesFromDBGenerator generator = new EntitiesFromDBGenerator(tableNames, true, true, regenTablesAttrs,
                FetchType.DEFAULT, CollectionType.LIST,
                packageName, location, dbconn, project, unit);
        // PENDING
        final Set<FileObject> entities = generator.generate(AggregateProgressFactory.createProgressContributor("PENDING"));

        String[] result = new String[entities.size()];
        int count = 0;
        for (FileObject fob : entities) {
            result[count++] = packageName + '.' + fob.getName();
        }
        return result;
    } catch (SQLException sex) {
        Logger.getLogger(J2EEUtils.class.getName()).log(Level.INFO, null, sex);
    } catch (IOException ioex) {
        Logger.getLogger(J2EEUtils.class.getName()).log(Level.INFO, null, ioex);
    }
    return null;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:35,代碼來源:J2EEUtils.java

示例2: getFetchType

public FetchType getFetchType() {
    int selected = fetchComboBox.getSelectedIndex();
    if(selected == 0 ) {
        return FetchType.DEFAULT;
    } else if(selected == 1 ) {
        return FetchType.EAGER;
    } else {
        return FetchType.LAZY;
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:10,代碼來源:MappingOptionsPanel.java

示例3: getFetchType

public FetchType getFetchType() {
     return FetchType.DEFAULT;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:3,代碼來源:DbSchemaEjbGeneratorTest.java

示例4: EntitiesFromDBGenerator

/**
 * Creates a new instance of EntitiesFromDBGenerator.
 *
 * @param tableNames the names of the tables for which entities are generated. Must not be null.
 * @param generateNamedQueries specifies whether named queries should be generated.
 * @param packageName the name of the package for the generated entities. Must not be null.
 * @param location the location. Must not be null.
 * @param connection the database connection for the specified tables. Must not be null.
 * @param project the project to which entities are generated.
 * @param persistenceUnit the persistenceUnit to which generated entities should be added
 * as managed classes. May be null, in which case it is up to the client to add
 * the generated entities to an appropriate persistence unit (if any).
 *
 */
public EntitiesFromDBGenerator(List<String> tableNames, boolean generateNamedQueries,
        String packageName, SourceGroup location, DatabaseConnection connection,
        Project project, PersistenceUnit persistenceUnit) {
    
    this(tableNames, generateNamedQueries, false, false, FetchType.DEFAULT, CollectionType.COLLECTION,
            packageName, location, connection, project, persistenceUnit);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:21,代碼來源:EntitiesFromDBGenerator.java


注:本文中的org.netbeans.modules.j2ee.persistence.entitygenerator.EntityRelation.FetchType.DEFAULT屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。