final List < DBColumn > getPrimaryKeyColumnList ( ) { final List < DBColumn > primaryKeyColumnList = new ArrayList < DBColumn > ( ) ; final Set < String > columnNameSet = getAllColumnNames ( ) ; for ( String columnName : columnNameSet ) { final D6ModelClassFieldInfo fieldInfo = getFieldInfo ( columnName ) ; final Field field = fieldInfo . field ; final DBColumn dbColumn = field . getAnnotation ( DBColumn . class ) ; if ( dbColumn . isPrimaryKey ( ) ) { primaryKeyColumnList . add ( dbColumn ) ; } } return primaryKeyColumnList ; }
Returns DBColumn list of primary key