If we have 2 micro services like employee and department, then can we do association mapping between employee and department entity class?

|
Debiprasad Dash 2022-09-22 09:21:47
Spark 2022-09-22 09:20:49
Or you are missing some context path in the url

Everything is fine

Ranjit kumar 2022-09-22 09:22:06
If we have 2 micro services like employee and department, then can we do association mapping between employee and department entity class?
Ranjit kumar 2022-09-22 09:22:24
In other word, can two different entities in two different microservices have a relationship like @OneToMany
ashu4792 2022-09-22 09:23:15
Debiprasad Dash 2022-09-22 09:21:47
Everything is fine

Have you inherited the method SpringBootInitializer in the main class?

ashu4792 2022-09-22 09:23:51
*SpringBootServletInitializer
ashu4792 2022-09-22 09:24:02
and override the configure mwthod
Debiprasad Dash 2022-09-22 09:24:19
springbootmicroservices-80223.jpg

Debiprasad Dash 2022-09-22 09:24:27
This is main class
Debiprasad Dash 2022-09-22 09:24:47
springbootmicroservices-80225.jpg

Debiprasad Dash 2022-09-22 09:24:50
Controller
ashu4792 2022-09-22 09:25:00
Debiprasad Dash 2022-09-22 09:24:19
springbootmicroservices-80223.jpg

extend SpringBootServletInitializer

Spark 2022-09-22 09:25:04
ashu4792 2022-09-22 09:23:51
springbootmicroservices-80223.jpg
*SpringBootServletInitializer

Yah for embedded servers this is optional but to run on external this is required

Debiprasad Dash 2022-09-22 09:25:04
springbootmicroservices-80228.jpg

ashu4792 2022-09-22 09:25:28
For ex: Application.java is main class then
ashu4792 2022-09-22 09:25:30
@SpringBootApplication
public class Application extends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}

@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return builder.sources(Application.class);
}
}

Debiprasad Dash 2022-09-22 09:29:10
Not working
Debiprasad Dash 2022-09-22 09:29:18
ashu4792 2022-09-22 09:25:30
springbootmicroservices-80223.jpg
@SpringBootApplication
public class Application extends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}

@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return builder.sources(Application.class);
}
}

Its not required

ashu4792 2022-09-22 09:31:21
SpringBootServletInitializer ?
Debiprasad Dash 2022-09-22 09:32:46
No it’s not required
Debiprasad Dash 2022-09-22 09:32:54
I got the issue
ashu4792 2022-09-22 09:33:52
If this doesn’t work then I am afraid you need to downgrade you r tomcat version
Debiprasad Dash 2022-09-22 09:34:36
ashu4792 2022-09-22 09:33:52
springbootmicroservices-80223.jpg
If this doesn’t work then I am afraid you need to downgrade you r tomcat version

I have choose jar so it is not working in external server it should be war
That’s the reason

Debiprasad Dash 2022-09-22 09:34:55
ashu4792 2022-09-22 09:33:52
springbootmicroservices-80223.jpg
If this doesn’t work then I am afraid you need to downgrade you r tomcat version

Thank you bro for replying

ashu4792 2022-09-22 09:35:30
Debiprasad Dash 2022-09-22 09:34:36
springbootmicroservices-80223.jpg
I have choose jar so it is not working in external server it should be war
That’s the reason

okay

ashu4792 2022-09-22 09:35:41
Debiprasad Dash 2022-09-22 09:34:55
springbootmicroservices-80223.jpg
Thank you bro for replying

You’re welcome

Spark 2022-09-22 09:35:45
ashu4792 2022-09-22 09:25:30
springbootmicroservices-80223.jpg
@SpringBootApplication
public class Application extends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}

@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return builder.sources(Application.class);
}
}

Actually it’s required when you are going to deploy in tomcat container as war…. To just run in browser temporarily it’s not required I think… Correct me if iam wrong

Zaahhx 2022-09-22 09:42:28
How to do one to many mapping.

I need to generate  a column and by default it is having null values. I have specified @notnull attribute.

I am getting the error as :
Null value in col xyz of relation abcd violates not-null constraint

Ranjit kumar 2022-09-22 10:02:34
Ranjit kumar 2022-09-22 09:22:24
springbootmicroservices-80223.jpg
In other word, can two different entities in two different microservices have a relationship like @OneToMany

Can anyone reply on this please?

Ajay 2022-09-22 10:14:14
Anyone from Infosys
msd 2022-09-22 10:17:49
Anyone here already working in a company on springboot or Microservices??
|