5/23 9:34
This commit is contained in:
parent
9ba56b4d47
commit
26db9e99f1
2
.idea/compiler.xml
generated
2
.idea/compiler.xml
generated
@ -9,7 +9,7 @@
|
|||||||
<outputRelativeToContentRoot value="true" />
|
<outputRelativeToContentRoot value="true" />
|
||||||
<module name="printer-522work" />
|
<module name="printer-522work" />
|
||||||
<module name="spring519" />
|
<module name="spring519" />
|
||||||
<module name="spring-mybatis01-522" />
|
<module name="spring-mybatis01-522-523" />
|
||||||
<module name="mybatis519" />
|
<module name="mybatis519" />
|
||||||
<module name="spring522-annotation" />
|
<module name="spring522-annotation" />
|
||||||
<module name="spring522" />
|
<module name="spring522" />
|
||||||
|
4
.idea/encodings.xml
generated
4
.idea/encodings.xml
generated
@ -13,8 +13,8 @@
|
|||||||
<file url="file://$PROJECT_DIR$/mybatis519/src/main/resources" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/mybatis519/src/main/resources" charset="UTF-8" />
|
||||||
<file url="file://$PROJECT_DIR$/printer-522work/src/main/java" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/printer-522work/src/main/java" charset="UTF-8" />
|
||||||
<file url="file://$PROJECT_DIR$/printer-522work/src/main/resources" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/printer-522work/src/main/resources" charset="UTF-8" />
|
||||||
<file url="file://$PROJECT_DIR$/spring-mybatis01-522/src/main/java" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/spring-mybatis01-522-523/src/main/java" charset="UTF-8" />
|
||||||
<file url="file://$PROJECT_DIR$/spring-mybatis01-522/src/main/resources" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/spring-mybatis01-522-523/src/main/resources" charset="UTF-8" />
|
||||||
<file url="file://$PROJECT_DIR$/spring519/src/main/java" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/spring519/src/main/java" charset="UTF-8" />
|
||||||
<file url="file://$PROJECT_DIR$/spring519/src/main/resources" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/spring519/src/main/resources" charset="UTF-8" />
|
||||||
<file url="file://$PROJECT_DIR$/spring522-annotation/src/main/java" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/spring522-annotation/src/main/java" charset="UTF-8" />
|
||||||
|
1
.idea/misc.xml
generated
1
.idea/misc.xml
generated
@ -18,6 +18,7 @@
|
|||||||
<option value="$PROJECT_DIR$/spring522-annotation/pom.xml" />
|
<option value="$PROJECT_DIR$/spring522-annotation/pom.xml" />
|
||||||
<option value="$PROJECT_DIR$/spring-mybatis01-522/pom.xml" />
|
<option value="$PROJECT_DIR$/spring-mybatis01-522/pom.xml" />
|
||||||
<option value="$PROJECT_DIR$/printer-522work/pom.xml" />
|
<option value="$PROJECT_DIR$/printer-522work/pom.xml" />
|
||||||
|
<option value="$PROJECT_DIR$/spring-mybatis01-522-523/pom.xml" />
|
||||||
</list>
|
</list>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<groupId>org.example</groupId>
|
<groupId>org.example</groupId>
|
||||||
<artifactId>spring-mybatis01-522</artifactId>
|
<artifactId>spring-mybatis01-522-523</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
@ -5,6 +5,7 @@ import cn.czyx007.dao.TbBrandDao;
|
|||||||
import cn.czyx007.service.TbBrandService;
|
import cn.czyx007.service.TbBrandService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (TbBrand)表服务实现类
|
* (TbBrand)表服务实现类
|
||||||
@ -13,6 +14,7 @@ import org.springframework.stereotype.Service;
|
|||||||
* @since 2023-05-22 15:33:50
|
* @since 2023-05-22 15:33:50
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
|
@Transactional
|
||||||
public class TbBrandServiceImpl implements TbBrandService {
|
public class TbBrandServiceImpl implements TbBrandService {
|
||||||
@Autowired
|
@Autowired
|
||||||
TbBrandDao tbBrandDao;
|
TbBrandDao tbBrandDao;
|
||||||
@ -34,9 +36,11 @@ public class TbBrandServiceImpl implements TbBrandService {
|
|||||||
* @param tbBrand 实例对象
|
* @param tbBrand 实例对象
|
||||||
* @return 实例对象
|
* @return 实例对象
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TbBrand insert(TbBrand tbBrand) {
|
public TbBrand insert(TbBrand tbBrand) {
|
||||||
this.tbBrandDao.insert(tbBrand);
|
this.tbBrandDao.insert(tbBrand);
|
||||||
|
int i = 1/0;
|
||||||
return tbBrand;
|
return tbBrand;
|
||||||
}
|
}
|
||||||
|
|
@ -1,14 +1,20 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||||
xmlns:context="http://www.springframework.org/schema/context"
|
xmlns:context="http://www.springframework.org/schema/context"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
|
||||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||||
http://www.springframework.org/schema/context
|
http://www.springframework.org/schema/context
|
||||||
http://www.springframework.org/schema/context/spring-context.xsd">
|
http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
|
||||||
|
|
||||||
<context:component-scan base-package="cn.czyx007.*"/>
|
<context:component-scan base-package="cn.czyx007.*"/>
|
||||||
|
|
||||||
|
<bean id="tx" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
|
||||||
|
<property name="dataSource" ref="druidDataSource"/>
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
<tx:annotation-driven transaction-manager="tx" proxy-target-class="true"/>
|
||||||
|
|
||||||
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
||||||
<property name="location" value="classpath:jdbc.properties"/>
|
<property name="location" value="classpath:jdbc.properties"/>
|
||||||
</bean>
|
</bean>
|
@ -21,4 +21,12 @@ public class TestDemo {
|
|||||||
TbBrand tbBrand = brandService.queryById(5);
|
TbBrand tbBrand = brandService.queryById(5);
|
||||||
System.out.println("tbBrand = " + tbBrand);
|
System.out.println("tbBrand = " + tbBrand);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void test2(){
|
||||||
|
TbBrand brand = new TbBrand();
|
||||||
|
brand.setId(123);
|
||||||
|
brand.setBrandName("123");
|
||||||
|
brandService.insert(brand);
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user