简体   繁体   English

是否有一个类似于usingColumns()的SimpleJdbcInsert方法,该方法将排除列列表作为参数?

[英]Is there a SimpleJdbcInsert method similar to usingColumns(), which takes excluded columns list as an argument?

SimpleJdbcInsert has a method usingColumns(String...), where you define set of columns, included in the insert statement. SimpleJdbcInsert有一个usingColumns(String ...)的方法,您可以在其中定义包含在insert语句中的一组列。

But sometimes an opposite functionality is preferred, like while having a 25-column table with one autogenerated column (eg timestamp set to current date/time) one would prefer to mention this one column as excluded from insert, instead of mentioning 24 columns. 但是有时候,相反的功能是更可取的,例如在具有一个自动生成的列的25列表中(例如,将时间戳设置为当前日期/时间),人们宁愿将这一列从插入中排除,而不是提及24列。

The question is, is there a way (another method or workaround) to provide excluded columns list instead of included columns? 问题是,是否有一种方法(另一种方法或解决方法)提供排除列列表而不是包括列?

The question is, is there a way (another method or workaround) to provide excluded columns list instead of included columns? 问题是,是否有一种方法(另一种方法或解决方法)提供排除列列表而不是包括列?

That you can achieve by using SimpleJdbcInsert.usingGeneratedKeyColumns(String...) method. 您可以通过使用SimpleJdbcInsert.usingGeneratedKeyColumns(String ...)方法来实现。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 单元测试以列表为参数的方法 - unit testing a method that takes a list as an argument Eclipse Milo:如何调用以customDataType作为参数的方法? - Eclipse Milo: How to call method which takes a customDataType as argument? 编写一个方法 isAbleToFly(),它不接受任何参数并返回 true 或 false? - Writing a method isAbleToFly(), which takes no argument and returns true or false? 编写一个名为 isPrime 的方法,它将 integer 作为参数,如果参数是素数则返回 true - Write a method named isPrime, which takes an integer as an argument and returns true if the argument is a prime number 在名为OddTest的类中编写一个名为isOdd()的方法,该方法将int作为参数,如果int为奇数,则返回true - Write a method called isOdd() in a class called OddTest, which takes an int as an argument and returns true if the int is odd 如何正确使用以 Book 作为参数的 removeBook(Book) 方法 - How do I correctly use a removeBook(Book) method which takes a Book as an argument 类的模拟方法 <?> 用JMock输入参数 - Mocking Method that Takes a Class<?> Type Argument with JMock 测试一个带有JUnit理论的String参数的方法 - Test a method that takes an String argument with JUnit theories 写作单元测试,需要2个列表 - Writing Unittest which takes 2 list MySQL DB 上的 SimpleJdbcInsert 在 executeAndReturnKey 方法后返回 BigInteger 而不是 Long - SimpleJdbcInsert on MySQL DB returning BigInteger instead of Long after executeAndReturnKey method
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM