/** * Factory method for building and throwing an UnresolvableObjectException if the entity is null. * * @param entity The entity to check for nullness * @param identifier The identifier of the entity * @param entityName The name of the entity * * @throws UnresolvableObjectException Thrown if entity is null */ public static void throwIfNull(Object entity, Serializable identifier, String entityName) throws UnresolvableObjectException { if ( entity == null ) { throw new UnresolvableObjectException( identifier, entityName ); } }
public HibernateObjectRetrievalFailureException(UnresolvableObjectException ex) { super(ex.getEntityName(), ex.getIdentifier(), ex.getMessage(), ex); }
Object result = event.getResult(); if ( !nullable ) { UnresolvableObjectException.throwIfNull( result, id, entityName );
throw new UnresolvableObjectException( e.getId(), "this instance does not yet exist as a row in the database" UnresolvableObjectException.throwIfNull( result, id, persister.getEntityName() );
private static net.sf.hibernate.UnresolvableObjectException adaptUnresolvableObjectException( final org.hibernate.UnresolvableObjectException ex) { final String message = ex.getMessage(); return new net.sf.hibernate.UnresolvableObjectException(ex.getIdentifier(), null) { @Override public String getMessage() { return message; } @Override public String toString() { return toStringWithClassName(this, net.sf.hibernate.UnresolvableObjectException.class); } }; }
return new ObjectRetrievalFailureException(hibEx.getEntityName(), hibEx.getIdentifier(), ex.getMessage(), ex);
this.getLoadQueryInfluencers().setInternalFetchProfile( previousFetchProfile ); UnresolvableObjectException.throwIfNull( result, id, persister.getEntityName() );
throw new UnresolvableObjectException( e.getId(), "this instance does not yet exist as a row in the database" UnresolvableObjectException.throwIfNull( result, id, entityDescriptor.getEntityName() );
return new ObjectRetrievalFailureException(hibEx.getEntityName(), hibEx.getIdentifier(), ex.getMessage(), ex);
public HibernateObjectRetrievalFailureException(UnresolvableObjectException ex) { super(ex.getEntityName(), ex.getIdentifier(), ex.getMessage(), ex); }
public Object internalLoad(String entityName, Serializable id, boolean eager, boolean nullable) throws HibernateException { // todo : remove LoadEventListener.LoadType type = nullable ? LoadEventListener.INTERNAL_LOAD_NULLABLE : eager ? LoadEventListener.INTERNAL_LOAD_EAGER : LoadEventListener.INTERNAL_LOAD_LAZY; LoadEvent event = new LoadEvent(id, entityName, true, this); Object result = listeners.getLoadEventListener().onLoad(event, type); if (!nullable) UnresolvableObjectException.throwIfNull(result, id, entityName); return result; }
public static void throwIfNull(Object o, Serializable id, String clazz) throws UnresolvableObjectException { if (o==null) throw new UnresolvableObjectException(id, clazz); }
public HibernateObjectRetrievalFailureException(UnresolvableObjectException ex) { super(ex.getEntityName(), ex.getIdentifier(), ex.getMessage(), ex); }
public Object internalLoad(String entityName, Serializable id, boolean eager, boolean nullable) throws HibernateException { // todo : remove LoadEventListener.LoadType type = nullable ? LoadEventListener.INTERNAL_LOAD_NULLABLE : eager ? LoadEventListener.INTERNAL_LOAD_EAGER : LoadEventListener.INTERNAL_LOAD_LAZY; LoadEvent event = new LoadEvent(id, entityName, true, this); fireLoad(event, type); if ( !nullable ) { UnresolvableObjectException.throwIfNull( event.getResult(), id, entityName ); } return event.getResult(); }
public static void throwIfNull(Object o, Serializable id, String clazz) throws UnresolvableObjectException { if (o==null) throw new UnresolvableObjectException(id, clazz); }
public HibernateObjectRetrievalFailureException(UnresolvableObjectException ex) { super(ex.getEntityName(), ex.getIdentifier(), ex.getMessage(), ex); }
public Object internalLoad(String entityName, Serializable id, boolean eager, boolean nullable) throws HibernateException { // todo : remove LoadEventListener.LoadType type = nullable ? LoadEventListener.INTERNAL_LOAD_NULLABLE : eager ? LoadEventListener.INTERNAL_LOAD_EAGER : LoadEventListener.INTERNAL_LOAD_LAZY; LoadEvent event = new LoadEvent(id, entityName, true, this); fireLoad(event, type); if ( !nullable ) { UnresolvableObjectException.throwIfNull( event.getResult(), id, entityName ); } return event.getResult(); }
public static void throwIfNull(Object o, Serializable id, String clazz) throws UnresolvableObjectException { if (o==null) throw new UnresolvableObjectException(id, clazz); }
public HibernateObjectRetrievalFailureException(UnresolvableObjectException ex) { super(ex.getEntityName(), ex.getIdentifier(), ex.getMessage(), ex); }
public Object internalLoad(String entityName, Serializable id, boolean eager, boolean nullable) throws HibernateException { // todo : remove LoadEventListener.LoadType type = nullable ? LoadEventListener.INTERNAL_LOAD_NULLABLE : eager ? LoadEventListener.INTERNAL_LOAD_EAGER : LoadEventListener.INTERNAL_LOAD_LAZY; LoadEvent event = new LoadEvent(id, entityName, true, this); fireLoad(event, type); if ( !nullable ) { UnresolvableObjectException.throwIfNull( event.getResult(), id, entityName ); } return event.getResult(); }