Home > Back-end >  In the Spring of a class of object type variable attribute assignment problems
In the Spring of a class of object type variable attribute assignment problems

Time:09-29



1. The Student is how to use annotations to configuration Bean attribute of an object?
2. There are two the teacher class, corresponding to the student's name and subject attribute is different also, how to inject the data?
3. If direct use Value on Student class (" Ming "), the Chinese teacher?

CodePudding user response:

Two the teacher class, property, extract subjects into one

CodePudding user response:

reference 1st floor bug10086 response:
two the teacher class, property, extract subjects into a

This is only an example, try not to change source cases through the Spring annotations to attribute assignment to the other side,
  • Related