« first day (583 days earlier)      last day (1655 days later) » 

5:11 AM
Good morning @SpringLearner, @greenhorn, @Tajinder
 
6:04 AM
@jens :Good morning how are you ? how was your weekend ?
 
@Tajinder Hi. I am fine. The weekend was ok. thanks for asking. How are you? What you have done on weekend?
 
Good Morning Everyone!
 
@JudeNiroshan Good morning
 
General Elections .... Hate this game!
how are you @Jens ? and @Tajinder ; you too ?
5 mins ago, by Jens
@Tajinder Hi. I am fine. The weekend was ok. thanks for asking. How are you? What you have done on weekend?
 
@JudeNiroshan I am fine. Thanks for aksing. And you?
 
6:14 AM
they dominated my pinky -_-
 
@jude Niroshan i am good thanks and you ?
@Jens... i am good, weekend was good, yesterday we went to Zurich ,it rained whole day ,so quite good for me . :)
 
Whoever flagged "General Elections .... Hate this game!": Don't flag that as spam / offensive -.-
It's neither.
 
fine. It was quite weekend for me.
@Cerbrus huh? flagged ? 0.O
 
Yea
 
@jude Niroshan : what have you done on weekend ?
 
6:18 AM
It was flagged. Which is retarded
 
I was designing the web page for HR module for my 2nd year final semester client project. One guy in our project has messed up with jQuery versions... No console errors, but nothing is appearing. struck with those kind of errors in weekend.
 
@jude : So you able to resolve them ?
 
something that i made me happy was; i have done a big searching part in another client project which i'm working on parallel ^_^
@Tajinder partially. I think i should use the most latest jQuery each and every single page. After few years i'm fully working on html and designing part
anyone have experience in sending emails in php project ?
 
@jens: for my database thing which we discussed on thursday or friday(in case you remember).... we will use old db as of now and we will create views in old db itself..... views will be according to the data we require for new project.... do you think its fine? fetching the db views directly ? I think it would be fast.
@Jude... thats good.... so your weekend was successful one.
 
@Tajinder What means "directly" in your case?
 
6:30 AM
@jens ... i mean data will be fetched from views (which we will create for new project) in old db itself. other option was to create wrappers. so i just want to ask your reviews on this approach(creating views)
 
@Tajinder Ok now i understand. I think views are ok.
@Tajinder So you do not use xml or json as your team discuss last week?
 
6:48 AM
@jens : no we are not... actually we are at point ,where we do not know how should we move further.
@jens... suppose we have views ready with data we need ... than what would you recommend to use JDBC Template or as you said JPA-Data?
 
@Tajinder If I had to decide i would use JPA or sping-data-jpa with hibernate.
 
JPA means Spring JPA right ?
 
@Tajinder Yes of cource.
 
@jens... ok thanks.... we have meeting there they will decide... how to move further... i will let you know. :)
 
@Tajinder OK thanks.
 
 
1 hour later…
8:15 AM
@Jens.... i went through this Spring JPA-Data tutorial
@jens so does that mean i will define my all operations,save,delete,update in public interface CustomerRepository extends CrudRepository<Customer, Long> {

List<Customer> findByLastName(String lastName);
}
 
@Tajinder Yes.
 
in Interface Repository ? and i will have 1 interface for every table/Vie
View
 
@Tajinder Yes that's it
 
ok , So all i need is 1 Entity (which represents my view in db) and one Interface for every View.... thats it nothing else?
@Jens
ok , So all i need is 1 Entity (which represents my view in db) and one Interface for every View.... thats it nothing else?
@jens... ofcourse one service class where i will perform the operations and all but other than that :::: my 1 view in db ----- 1 entity and 1 Repository
 
@Tajinder For nomal use, that should be all. For more complex thinks maybe you need some more interfaces/classes. See here. spring.io/blog/2011/04/26/…
 
8:21 AM
@jens : ok
@jens thanks :)
 
@Tajinder You are welcome.
 
 
1 hour later…
9:26 AM
@jens... to my surprise one of my colleague has already started working on db thing in jPA-Data itself.
@jens first of all i have this question: how can we change spring datasource at run time?
we have defined in properties files as
#spring.datasource.driver-class-name=com.mysql.jdbc.Driver
#spring.datasource.url=jdbc:mysql://localhost/core
#spring.datasource.username=gatclims
#spring.datasource.password=gatclimsPWD
but if we want to use another one at run time,is it possible ?
 
@Tajinder No you have to define two datasources and autowire that one you would like to use in the dao.
 
@jens... i did not understand completely, so i should not use it using properties file at all?
 
@Tajinder You can use a property file of course. But you have to define the properies twice like
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
and
spring.datasource_old.driver-class-name=xxx.xxxx.xxxx..xxx
and then you can define two datasources in you application context
one uses the properties datasource and the other datasource_old
Do you understand what i mean @Tajinder
 
@jens ... i understood jens so far what you have explained.... but how i will autowire them where i need it ?
@jens : i mean which bean exactly ? Sorry for dumb question but i am confused here.
 
@Tajinder There is no dumb question.
 
9:38 AM
@jens... @Autowired private ApplicationContext applicationContext;
 
No this is a missunderstanding. You define a persitence unit in spring .
@Tajinder Better idea. Read this: codingpedia.org/ama/…
 
@jens.... ok thanks.will read and if i face,i come back to you :)
 
@Tajinder OK then after lunch.
 
@jens.. guten Apettite dann
 
@Tajinder Danke.
 
9:57 AM
Hi @Jens
 
@Jens good afternoon
I need one help
 
10:10 AM
@SpringLearner Hi what is your problem
@arch Hi
 
@Jens are you familiar with database structure, sql views n all?
 
@arch Yes i think so.
 
can you plz check this que?
2
Q: Creating SQL view by joining 7 Tables

archI want to create a view by joining 7 tables. I have created also, but it is not showing any data from real tables I am using to join. At 1st I have created view by joining 2 tables only. It worked fine and showing data, CREATE VIEW tbi_dd_detail_view AS SELECT d.dd_metric_config_id, ...

 
@arch Have you tried to use left join? To figure out which table has no data?
 
yes i used tat also
 
10:20 AM
2
Q: Unable to show 4 products in row in subcategory/shop page woocommerce

Rahul BajajI'm unable to show 4 products in a row, I just put the filter in my themes/functions.php. Code is below: function loop_columns(){ return 4; } add_filter('loop_shop_columns', 'loop_columns',999); When I return 3, all working is fine, but when I put 4 here, it shows the grid like this: Prod...

 
at last i put output image..n last comment.. plz check tat @Jens
 
@arch Do you men this comment: "as per your suggestion, is it good to create single table with exactly same fields i have mentioned in my question?? It wont effect the performance? "?
 
i have added output of joining 3 tables using LEFT JOIN. It is giving output as i edited my question. dd_metric_config_id = 5 should give 2 datas only, instead it is giving 4datas and dd_query_id is repeating
this one @Jens
 
Can you give me the ddl of the tables?
@RahulBajaj Sorry no experience with wordpress
@arch Can you give me the ddl of the tables?
 
10:40 AM
@jens
@Configuration
public class CrudConfigurationBeans {

@Bean
@Primary
@ConfigurationProperties(prefix = "spring.datasourceNextGenLims")
public DataSource primaryDataSource() {
return DataSourceBuilder.create().build();
}

@Bean
@ConfigurationProperties(prefix = "spring.datasourceMyGatcLims")
public DataSource secondaryDataSource() {
return DataSourceBuilder.create().build();
}
}
@jens and my property file
spring.datasourceNextGenLims.driver-class-name=com.mysql.jdbc.Driver
spring.datasourceNextGenLims.url=jdbc:mysql://localhost/core
spring.datasourceNextGenLims.username=gatclims
spring.datasourceNextGenLims.password=gatclimsPWD

spring.datasourceMyGatcLims.driver-class-name=com.mysql.jdbc.Driver
spring.datasourceMyGatcLims.url=jdbc:mysql://localhost/corexyz
spring.datasourceMyGatcLims.username=gatclimsxyz
spring.datasourceMyGatcLims.password=gatclimsPWD
 
@Tajinder Looks great.
 
@jens... but how i will access them ?i mean how these will be autowired?
 
@Tajinder You also need a persistence unit so you can work with it as in normal spring applications.
@Tajinder Have you read the page i suggested?
 
@jens...i have read but not all... because i noticed its for spring and i am using Spring boot. and in spring boot there is no xml configuration included
 
@Tajinder You can also write it in annotation based way.
 
10:54 AM
@jens
@Bean
public LocalContainerEntityManagerFactoryBean nextGenEntityManagerFactory(
EntityManagerFactoryBuilder builder) {
return builder
.dataSource(primaryDataSource())
.packages(Customer.class)
.persistenceUnit("customers")
.build();
}

@Bean
public LocalContainerEntityManagerFactoryBean myGatcEntityManagerFactory(
EntityManagerFactoryBuilder builder) {
return builder
.dataSource(secondaryDataSource())
.packages(Order.class)
.persistenceUnit("orders")
.build();
}
i added persistent unit like this
but packages? what i am suppose to define here?
 
@Tajinder The package name where you have the entity classes.
 
can i make it same in both beans?
 
@Tajinder Yes if it are the same entities you use.
 
@Jens
CREATE TABLE IF NOT EXISTS `tbi_dd_config_master` (
`dd_metric_config_id` int(11) NOT NULL,
`created_by` int(11) NOT NULL,
`created_date` datetime NOT NULL,
`domain_id` int(11) NOT NULL,
`is_active` varchar(1) NOT NULL,
`keywords` varchar(255) DEFAULT NULL,
`metric_name` varchar(255) DEFAULT NULL,
`modified_by` int(11) DEFAULT NULL,
`modified_date` datetime DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
CREATE TABLE IF NOT EXISTS `tbi_dd_custom_query_config` (
`dd_query_id` int(11) NOT NULL,
`created_by` int(11) NOT NULL,
`created_date` datetime NOT NULL,
`query` varchar(255) DEFAULT NULL,
`datasource_id` int(11) NOT NULL,
`is_active` varchar(1) NOT NULL,
`modified_by` int(11) DEFAULT NULL,
`modified_date` datetime DEFAULT NULL,
`virtual_query_name` varchar(255) DEFAULT NULL,
`dd_metric_config_id` int(11) DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
 
@arch And the third table?
 
11:04 AM
CREATE TABLE IF NOT EXISTS `tbi_dd_dataview_config` (
`dd_dataview_id` int(11) NOT NULL,
`created_by` int(11) NOT NULL,
`created_date` datetime NOT NULL,
`dataview_id` int(11) NOT NULL,
`is_active` varchar(1) NOT NULL,
`modified_by` int(11) DEFAULT NULL,
`modified_date` datetime DEFAULT NULL,
`dd_metric_config_id` int(11) DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
 
@arch Can you also show the values of table tbi_dd_dataview_config for d.dd_metric_config_id=5?
 
check this image
i have used even distinct.. it dint work.. it gave me same result @Jens
 
@arch I think you have to add the dataview_id to the join: tbi_dd_dataview_config v ON c.dd_metric_config_id = v.dd_metric_config_id and c.dataview_id = v.dataview_id
 
no.. there is no relation b/n 2nd n 3rd table.. only 1st table is connected to 2nd n 3rd
 
@arch But why you expect only two record if there are 4 in table 3?
 
11:23 AM
no.. there are 2 records only in 2nd n 3rd table w.r.t. d.dd_metric_config_id=5
 
@arch sorry havent seen that it is id 5 and 6.
@arch can you also show the data from second table?
 
ok
 
@arch Ok as you see there are 2 records for table2 and 2 records for table 3 wich will gives you 4 records. That is the truth.
@arch You can not get only 2 records.
 
oh ho !!!
but y dd_query_id is repeating??
 
@arch Yes bacause every record from table 2 will be joined with every record in table 3 which is called a cross product
 
11:33 AM
like tat i have to join 5 other tables.. then it ll give huge data.. i want to avoid tat @Jens
oh ok ok i got ur point!
there is no way to avoid tat? @Jens
 
@arch I don't think so, because there is no relationship between the tables.
 
Oh OK
Anyway thank u :) @Jens
 
@arch you are welcome
 
11:54 AM
@jens : @Bean
public LocalContainerEntityManagerFactoryBean nextGenEntityManagerFactory(
EntityManagerFactoryBuilder builder) {
return builder.dataSource(primaryDataSource())
.packages("com.gatcbiotech.blueberry.crud.entity")
.persistenceUnit("nextGen").build();
}

@Bean
public LocalContainerEntityManagerFactoryBean myGatcEntityManagerFactory(
EntityManagerFactoryBuilder builder) {
return builder.dataSource(secondaryDataSource())
.packages("com.gatcbiotech.blueberry.crud.entity")
.persistenceUnit("myGatc").build();
please see packages i have declared the full package name ...
is it fine?
 
@Tajinder Yes looks good
 
@jens.... i have defined persistent units and data sources...... and now to access them
@PersistenceContext(unitName="demoRestPersistence")
private EntityManager entityManager;

@PersistenceContext(unitName="demoRestPersistenceLegacy")
private EntityManager entityManagerLegacy;
this is what i found in link you gave me
 
@Tajinder Yes that's ít
 
12:33 PM
@jens.... Since i do not have so much exposure to JPA so far.... where we will use this EntityManager? in Repository Interface?
 
1:22 PM
@jens ... thanks for doc,i have read half of it.....
i understand now repository concept ,crud operations and many more
@jens
@Configuration
public class CrudConfigurationBeans {

@Bean
@Primary
@ConfigurationProperties(prefix = "spring.datasourceNextGenLims")
public DataSource primaryDataSource() {
return DataSourceBuilder.create().build();
}

@Bean
@ConfigurationProperties(prefix = "spring.datasourceMyGatcLims")
public DataSource secondaryDataSource() {
return DataSourceBuilder.create().build();
}

@Bean
public LocalContainerEntityManagerFactoryBean nextGenEntityManagerFactory(
EntityManagerFactoryBuilder builder) {
but i am getting exception
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'applicationController' defined in file [C:\git\blueberrycrud\target\classes\com\gatcbiotech\blueberry\crud\controller\ApplicationController.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [com.gatcbiotech.blueberry.crud.service.ApplicationService]: : Error creating bean with name 'applicationService' defined in file [C:\git\blueberrycrud\target\classes\com\gatcbiotech\blueberry\crud\service\ApplicationService.class]: Unsatisfied dependency expressed thr
 
@Tajinder Can yu show the code where you autowire the entitymanager?
 
@jens .... i am not doing it anywhere... this was my understanding that spring will handle it itself.
 
@jens.... here i am autowiring in Abstract class...
*/
@MappedSuperclass
public abstract class AbstractRepository<T> implements JpaRepository<T, Long> {

@Autowired
protected EntityManager em;
 
@Tajinder It it your class? or can you change it?
 
1:34 PM
@Jens yes.... this is the abstractRepository will be extended by rest of repositories
 
@Tajinder Ok then change:
@Bean(name="nextGenEntityManagerFactory")
public LocalContainerEntityManagerFactoryBean nextGenEntityManagerFactory(
And
@Autowired @Qualifier("nextGenEntityManagerFactory") protected EntityManager em;
And also you have to use thid for the other entitymanager
 
@jens .... it resolved one exception but i still have Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private javax.persistence.EntityManagerFactory com.gatcbiotech.blueberry.crud.Application.entityManagerFactory; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [javax.persistence.EntityManagerFactory] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowi
@jens is it because i have 2 beans
but i have autowired only one
Again sending my configuration file
@Configuration
public class CrudConfigurationBeans {

@Bean
@Primary
@ConfigurationProperties(prefix = "spring.datasourceNextGenLims")
public DataSource primaryDataSource() {
return DataSourceBuilder.create().build();
}

@Bean
@ConfigurationProperties(prefix = "spring.datasourceMyGatcLims")
public DataSource secondaryDataSource() {
return DataSourceBuilder.create().build();
}

@Bean(name = "nextGenEntityManagerFactory")
public LocalContainerEntityManagerFactoryBean nextGenEntityManagerFactory(
EntityManagerFactoryBuilder builder) {
 
@Tajinder No the error message says : No qualifying bean
@Tajinder Sorry my fault.
@Tajinder The entitymanager must have the annotation @PersistenceContext(name="nextGenEntityManagerFactory")
 
1:53 PM
@jens this is updated
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'applicationRepositoryInterface': Cannot create inner bean '(inner bean)#1a13fed' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#1a13fed': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException:
 
2:16 PM
@jens i think i need to read whole document first then i would able to resolve my problem and understand things better
@jens i think i will try tomorrow morning
@jens thanks a lot for help
bis Morgen\
 
@Tajinder You are welcome. Have a nice (cold) evening ;)
 

« first day (583 days earlier)      last day (1655 days later) »