@ SuppressWarnings ( "unused" ) private static JpaBean getJpaBeanAndProperties ( BeanId id ) { List < JpaProperty > props = JpaProperty . findProperties ( id ) ; if ( props . size ( ) == 0 ) { // no marker, bean does not exist return null ; } JpaBean bean = new JpaBean ( new JpaBeanPk ( id ) ) ; JpaProperty . filterMarkerProperty ( props ) ; bean . properties . addAll ( props ) ; return bean ; }
Need not consult the JpaBean table since the property marker in JpaProperties table is an indicator that the JpaBean really exist even if it has no properties .