Announcement Announcement Module
Collapse
No announcement yet.
Extract Datas from a referenced POJO Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Extract Datas from a referenced POJO

    Hi,

    I have two POJO
    FicheProjet
    Code:
    @Document(collection="FicheProjet")
    public class FicheProjet {
    	//Id Projet Evalué
    	@Id
    	String idProjet;
    	
    	String projetEvalue;
    	
    	String serviceProjet;
    	
    	String dateEvaluation;
    
    	String location;
    	
    	@DBRef
    	private Collaborateur collaborateur;
    		
          //  getters and  setters
    and Collaborateur

    Code:
    @Document(collection="User")
    public class Collaborateur {
       @Id
        private String id;
    
        private String nomCollaborateur;
    
        private String prenomCollaborateur;
        
    // Getters and Setters
    i can extract FicheProjet if expression match(even part of ) projetEvalue in FicheProjet

    Code:
     mongotemplate.find(new Query(Criteria.where(critere).regex(expression)),FicheProjet.class, "FicheProjet");
    
    // Critere  is the name of collection, and expression is the  expression searched (both are  taken from a form)
    how can i extract the FicheProjet if expression matchh(even part of ) referenced collaborateur in FicheProjet

    this doesnt work
    Code:
    mongotemplate.find(new Query(Criteria.where(critere).regex("collaborateur."+expression)),FicheProjet.class, "FicheProjet");
    Can i do it with one instruction?

    Thanks
Working...
X