/** * Return the metadata for the persistent or transactional field with * the given relative index. * * @return the field's metadata, or null if not found */ public FieldMetaData getDeclaredField(int index) { FieldMetaData[] fields = getDeclaredFields(); if (index < 0 || index >= fields.length) return null; return fields[index]; }
/** * Return the metadata for the persistent or transactional field with * the given relative index. * * @return the field's metadata, or null if not found */ public FieldMetaData getDeclaredField(int index) { FieldMetaData[] fields = getDeclaredFields(); if (index < 0 || index >= fields.length) return null; return fields[index]; }
/** * Return the metadata for the persistent or transactional field with * the given relative index. * * @return the field's metadata, or null if not found */ public FieldMetaData getDeclaredField(int index) { FieldMetaData[] fields = getDeclaredFields(); if (index < 0 || index >= fields.length) return null; return fields[index]; }
/** * Return the metadata for the persistent or transactional field with * the given relative index. * * @return the field's metadata, or null if not found */ public FieldMetaData getDeclaredField(int index) { FieldMetaData[] fields = getDeclaredFields(); if (index < 0 || index >= fields.length) return null; return fields[index]; }
/** * Return the metadata for the persistent or transactional field with * the given relative index. * * @return the field's metadata, or null if not found */ public FieldMetaData getDeclaredField(int index) { FieldMetaData[] fields = getDeclaredFields(); if (index < 0 || index >= fields.length) return null; return fields[index]; }
/** * Utility method to get names of all declared fields excluding the * superclasses' sorted in lexical order. */ public String[] getDeclaredFieldNames() { return toNames(getDeclaredFields()); }
/** * Utility method to get names of all declared fields excluding the * superclasses' sorted in lexical order. */ public String[] getDeclaredFieldNames() { return toNames(getDeclaredFields()); }
/** * Utility method to get names of all declared fields excluding the * superclasses' sorted in lexical order. */ public String[] getDeclaredFieldNames() { return toNames(getDeclaredFields()); }
/** * Returns the set of packages that needs to be imported for this code. */ public Set getImportPackages() { Set pkgs = new TreeSet(); pkgs.add(ClassUtil.getPackageName(_type.getSuperclass())); FieldMetaData[] fields = _meta.getDeclaredFields(); for (int i = 0; i < fields.length; i++) pkgs.add(ClassUtil.getPackageName(fields[i].getDeclaredType())); fields = _meta.getPrimaryKeyFields(); for (int i = 0; i < fields.length; i++) pkgs.add(ClassUtil.getPackageName(fields[i].getDeclaredType())); return pkgs; }
/** * Returns the set of packages that needs to be imported for this code. */ public Set getImportPackages() { Set pkgs = new TreeSet(); pkgs.add(ClassUtil.getPackageName(_type.getSuperclass())); FieldMetaData[] fields = _meta.getDeclaredFields(); for (int i = 0; i < fields.length; i++) pkgs.add(ClassUtil.getPackageName(fields[i].getDeclaredType())); fields = _meta.getPrimaryKeyFields(); for (int i = 0; i < fields.length; i++) pkgs.add(ClassUtil.getPackageName(fields[i].getDeclaredType())); return pkgs; }
/** * Validate that this class doesn't declare any primary key fields. */ private void validateNoPKFields() { FieldMetaData[] fields = getDeclaredFields(); for (int i = 0; i < fields.length; i++) if (fields[i].isPrimaryKey()) throw new MetaDataException(_loc.get("bad-pk", fields[i])); }
/** * Validate that this class doesn't declare any primary key fields. */ private void validateNoPKFields() { FieldMetaData[] fields = getDeclaredFields(); for (int i = 0; i < fields.length; i++) if (fields[i].isPrimaryKey()) throw new MetaDataException(_loc.get("bad-pk", fields[i])); }
/** * Validate that this class doesn't declare any primary key fields. */ private void validateNoPKFields() { FieldMetaData[] fields = getDeclaredFields(); for (int i = 0; i < fields.length; i++) if (fields[i].isPrimaryKey()) throw new MetaDataException(_loc.get("bad-pk", fields[i])); }
/** * Validate that this class doesn't declare any primary key fields. */ private void validateNoPKFields() { FieldMetaData[] fields = getDeclaredFields(); for (int i = 0; i < fields.length; i++) if (fields[i].isPrimaryKey()) throw new MetaDataException(_loc.get("bad-pk", fields[i])); }
/** * Validate that this class doesn't declare any primary key fields. */ private void validateNoPKFields() { FieldMetaData[] fields = getDeclaredFields(); for (int i = 0; i < fields.length; i++) if (fields[i].isPrimaryKey()) throw new MetaDataException(_loc.get("bad-pk", fields[i])); }
private void add(Class cls) { // assume all user-defined types are PCs ClassMetaData meta = getRepository().addMetaData(cls); FieldMetaData[] fmds = meta.getDeclaredFields(); for (int i = 0; i < fmds.length; i++) { if (fmds[i].getDeclaredTypeCode() == JavaTypes.OBJECT && fmds[i].getDeclaredType() != Object.class) fmds[i].setDeclaredTypeCode(JavaTypes.PC); } meta.setSource(_file, meta.getSourceType(), _file == null ? "" : _file.getPath()); _flush = true; }
private void add(Class cls) { // assume all user-defined types are PCs ClassMetaData meta = getRepository().addMetaData(cls); FieldMetaData[] fmds = meta.getDeclaredFields(); for (int i = 0; i < fmds.length; i++) { if (fmds[i].getDeclaredTypeCode() == JavaTypes.OBJECT && fmds[i].getDeclaredType() != Object.class) fmds[i].setDeclaredTypeCode(JavaTypes.PC); } meta.setSource(_file, meta.getSourceType(), _file == null ? "" : _file.getPath()); _flush = true; }
private void add(Class cls) { // assume all user-defined types are PCs ClassMetaData meta = getRepository().addMetaData(cls); FieldMetaData[] fmds = meta.getDeclaredFields(); for (int i = 0; i < fmds.length; i++) { if (fmds[i].getDeclaredTypeCode() == JavaTypes.OBJECT && fmds[i].getDeclaredType() != Object.class) fmds[i].setDeclaredTypeCode(JavaTypes.PC); } meta.setSource(_file, meta.getSourceType(), _file == null ? "" : _file.getPath()); _flush = true; }
private void add(Class cls) { // assume all user-defined types are PCs ClassMetaData meta = getRepository().addMetaData(cls); FieldMetaData[] fmds = meta.getDeclaredFields(); for (int i = 0; i < fmds.length; i++) { if (fmds[i].getDeclaredTypeCode() == JavaTypes.OBJECT && fmds[i].getDeclaredType() != Object.class) fmds[i].setDeclaredTypeCode(JavaTypes.PC); } meta.setSource(_file, meta.getSourceType(), _file == null ? "" : _file.getPath()); _flush = true; }
private void add(Class cls) { // assume all user-defined types are PCs ClassMetaData meta = getRepository().addMetaData(cls); FieldMetaData[] fmds = meta.getDeclaredFields(); for (int i = 0; i < fmds.length; i++) { if (fmds[i].getDeclaredTypeCode() == JavaTypes.OBJECT && fmds[i].getDeclaredType() != Object.class) fmds[i].setDeclaredTypeCode(JavaTypes.PC); } meta.setSource(_file, meta.getSourceType()); _flush = true; }