public ClassMetadata add ( Class < ? > clazz ) { ClassMetadata metadata = classMetadataFactory . createMetadata ( clazz ) ; log . debug ( "Adding persistent class " + metadata . getKind ( ) ) ; metadata . validate ( ) ; if ( metadataByKind . get ( metadata . getKind ( ) ) != null ) { throw new DuplicateException ( "Two entities found with kind='" + metadata . getKind ( ) + "': " + metadata . getPersistentClass ( ) . getName ( ) + " and " + metadataByKind . get ( metadata . getKind ( ) ) . getPersistentClass ( ) . getName ( ) ) ; } metadataByClass . put ( metadata . getPersistentClass ( ) , metadata ) ; metadataByKind . put ( metadata . getKind ( ) , metadata ) ; return metadata ; }
Adds a persistent class to the repository