/** {@inheritDoc} */ @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } final ManagedInstance<?> other = (ManagedInstance<?>) obj; return this.getId().equals(other.getId()); }
/** * Processes the associations. * * @since 2.0.0 */ public void processJoinedMappings() { ManagedInstance.LOG.debug("Post processing associations for instance {0}", this); final HashSet<String> _joinsLoaded = this.joinsLoaded; for (final PluralMappingEx<?, ?, ?> mapping : this.type.getMappingsPlural()) { final HashSet<String> joinsLoaded2 = _joinsLoaded; if (!joinsLoaded2.contains(mapping.getPath())) { if (mapping.isEager()) { mapping.load(this); } else { mapping.setLazy(this); } } } final X _instance = this.instance; final EntityManagerImpl entityManager = this.session.getEntityManager(); for (final SingularAssociationMappingImpl<?, ?> mapping : this.type.getAssociationsSingular()) { if (mapping.isEager()) { if (!_joinsLoaded.contains(mapping.getPath())) { mapping.initialize(this); } else { final Object associate = mapping.get(_instance); if (associate instanceof EnhancedInstance) { final EnhancedInstance enhancedInstance = (EnhancedInstance) associate; if (!enhancedInstance.__enhanced__$$__isInitialized()) { final ManagedInstance<?> associateManagedInstance = enhancedInstance.__enhanced__$$__getManagedInstance(); entityManager.find( associateManagedInstance.getType().getJavaType(), associateManagedInstance.getId().getId()); } } } } } }