fetch into 用法_英语常用的14种“省略”用法总结,终于明白为什么“省略”了...

1、并列复合句中某些相同成分的省略

He often regards English as easy and (he often regards)French as difficult.

他常把英语看作是容易学的,而法语是难学的

2、在用when,while,if,as if,though(although),as until,whether等连词引导的状语从句中,如果谓语有be,而主语又跟主句的主语相同或是it时,则从句的主语和be常可省略

When(water is)heated,water is turned into vapour.

水加热时变成气体

3、在than,as,no matter what(who等)分句后面常可省略某些成分

They do not use more water than(it is)necessary.

他们使用的水没有超出需要量

4e12a85da4b4d1891a3725957bb18004.png

4、在know,think,consider,suppose,find,belive,say,decide等动词后面所接的宾语从句中,连接词that常可省略

I think(that)it will clear up this afternoon.

我想今天下午天会转晴

5、在限制性定语从句中,作宾语用的关系代词whom,which,that常省略;在以the same...as和such...as引出的某些定语从句中,也可以省略与主句相同的成分

This is one of the best films(that)I've ever seen.

这是我所看过的最好的电影

6、在以there is开头的句子中,修饰主语的同位语从句的连接词常省略,修饰主语的定语从句的关系代词作主语,有时可以省略

There is a table(that)stands in the corner.

墙角处放着一张桌子

28f24b90b2c47eed3720f88d671e1879.png

7、用so,not或其他手段来替代上文或问句中的一部分或整个句意

--Can he do this work?他能做这件工作吗?

--I think so. 我想他行

8、在某些动词后的宾语补语和主语补语中可将to be省略

These books are thought(to be)very valuable

人们认为这些书很有价值

9、在“the+比较级...the+比较级...”结构中,有时可省略be或there be

The higher the temperature(is),the greater the pressure(is)

温度越高,压力越大

10、某些动词在接that从句时,不用与之搭配的介词

We agreed that is was a mistake.

我们一致认为,这是一个错误

11、用to表示前述动词不定式,其后面有关成分省略

You may go home ifyou like(to)

你如果想回家就可回家

d3c12e1f004aa42d9797ba767bb8ce4b.png

12、在某些虚拟语气的句子中可以省略should

I suggest that he(should)study more English before going abroad.

我建议他出国前多学点英语

13、在用so+that连接的从句中,常省略so或that

We are very tired,(so)that we had better hurry home.

我们很累,所以我们还是赶快回家去吧

14、省略介词in的几个固定词组

He spends his evenings(in)studying English

他把晚上的时间花在学英语上。

可以使用JPA的EntityManager来进行插入操作,首先需要在实体类上添加@Entity注解,并且在实体类中添加对应的属性和getter/setter方法。例如,假设实体类为BillingWater: ``` @Entity @Table(name = "billingwater") public class BillingWater { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private BigDecimal balance; @Column(name = "billDate") private Date billDate; @Column(name = "feeType") private String feeType; @Column(name = "iOFlag") private String iOFlag; @Column(name = "iOmoney") private BigDecimal iOmoney; private String remake; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "brokerEnterpriseFeeId") private BrokerEnterprise brokerEnterprise; // 省略getter/setter方法 } ``` 然后可以在对应的Repository中定义插入方法,例如: ``` public interface BillingWaterRepository extends JpaRepository<BillingWater, Long> { @Modifying @Query(value = "insert into billingwater (balance,billDate,feeType,iOFlag,iOmoney,remake,brokerEnterpriseFeeId) " + "VALUES (:balance, :billDate, :feeType, :iOFlag, :iOmoney, :remake, :brokerEnterpriseFeeId)", nativeQuery = true) void insertBillingWater(@Param("balance") BigDecimal balance, @Param("billDate") Date billDate, @Param("feeType") String feeType, @Param("iOFlag") String iOFlag, @Param("iOmoney") BigDecimal iOmoney, @Param("remake") String remake, @Param("brokerEnterpriseFeeId") Long brokerEnterpriseFeeId); } ``` 然后在插入之前可以判断字段是否为空,例如: ``` if(StringUtils.isNotBlank(billingWaterDTO.getBrokerEnterprise().getId().toString()) && StringUtils.isNotBlank(billingWaterDTO.getFeeType()) && StringUtils.isNotBlank(billingWaterDTO.getiOFlag()) && billingWaterDTO.getiOmoney() != null) { // 执行插入操作 BillingWater billingWater = new BillingWater(); BigDecimal balance = entityManager.createNativeQuery("select balance - :iOmoney as balance from billingwater where brokerEnterpriseFeeId = :id order by id desc limit 0,1") .setParameter("iOmoney", billingWaterDTO.getiOmoney()) .setParameter("id", billingWaterDTO.getBrokerEnterprise().getId()) .getSingleResult(); billingWater.setBalance(balance); billingWater.setFeeType(billingWaterDTO.getFeeType()); billingWater.setiOFlag(billingWaterDTO.getiOFlag()); billingWater.setiOmoney(billingWaterDTO.getiOmoney()); billingWater.setRemake(billingWaterDTO.getRemake()); billingWater.setBrokerEnterprise(brokerEnterpriseRepository.findById(billingWaterDTO.getBrokerEnterprise().getId()).orElse(null)); if (billingWaterDTO.getBillDate() == null) { billingWater.setBillDate(new Date()); } else { billingWater.setBillDate(billingWaterDTO.getBillDate()); } billingWaterRepository.save(billingWater); } ``` 其中,使用EntityManager的createNativeQuery()方法执行原生SQL查询,然后获取查询结果并设置到实体类中,最后使用JpaRepository的save()方法进行保存操作。 需要注意的是,在使用JpaRepository进行插入操作时,需要在对应的方法上添加@Modifying注解和@Query注解,并且将nativeQuery属性设置为true,表示使用原生SQL语句进行操作。同时,在设置参数时需要使用@Param注解来指定参数的名称。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值