#@Bean not working -- Spring

1 messages · Page 1 of 1 (latest)

untold shale
#

I'm trying to add in the data when I run the program but for some reason it doesn't seem to be working.
I think bean is the problem but it might be something else.

grim kayakBOT
#

<@&1004656351647117403> please have a look, thanks.

#

You can use </chatgpt:1108714622413963314> to ask ChatGPT about your question while you wait for a human to respond.

tropic pawn
#

What does it say lower in the stacktrace?

untold shale
#

alot of things similar to this

untold shale
tropic pawn
untold shale
untold shale
# tropic pawn

This is where that method is being initialized. not sure why it's expecting 1 argument

rare axle
#

Thats just a syntax error

#

I wonder why it does not underline that

rare axle
untold shale
#

my bad, initialized here

rare axle
#

Oh it does really not expect an argument peepoG

untold shale
#

yeah

rare axle
#

Bad naming

tropic pawn
#

Actually it does expect an argument implicitly.

#

It does expect an argument it can automatically bind for you to SkuCode, hence the error.

untold shale
#

I tried changing the name and am getting a different error (ig?)

#

I'm on the chit chat channel. Would you guys be able to join and help me out w this?

tropic pawn
#

Given you're expecting an Optional<Inventory> Spring Data does need to know how to reduce it from your full Inventory

#

So if you have findBySkuCode you would need to use findBySkuCode(String skuCode)

rare axle
#

Oh now i get it, forgot that this is a thing. Never really touched my repositories ever again lmao

tropic pawn
#

As you can see in your isInStock method in your InventoryService you're not actually passing your skuCode along (hence it being grayed out)

untold shale
#

got it

#

passed in the skuCode and works like a charm

#

Thanks @tropic pawn, @rare axle

tropic pawn
#

You're welcome.