Get by references entity in database manager
Fix types for Java 7