public void create ( final DbProduct dbProduct ) { if ( repositoryHandler . getProduct ( dbProduct . getName ( ) ) != null ) { throw new WebApplicationException ( Response . status ( Response . Status . CONFLICT ) . entity ( "Product already exist!" ) . build ( ) ) ; } repositoryHandler . store ( dbProduct ) ; }
Creates a new Product in Grapes database